Unable to access State in events

Hello,

Im having problem accessing react redux state in all events when using syncfusion component.
Im able to access it on native component.

please help. Thank you

heres my sample code:

import React from "react";
import {
  ComboBoxComponent,
  DropDownListComponent,
from "@syncfusion/ej2-react-dropdowns";

import { useSelectoruseDispatch } from 'react-redux';


const DetailSection = (props=> {

  const dispatch = useDispatch();
  
  const contractForm = useSelectorstate => state.ContractFormReducer.form);

  const CustomerFieldSettings = {
    text: "account_name",
    value: "cust_account_id",
  };


  const onCustomerChange = async (e=> {
    const form = contractForm ;
    console.log(form);
    // undefined 
    // but its appearing when using native input

  };

  return (
    <div id="detailsection">
      <ComboBoxComponent
            ref={customerRef}
            id="customerText"
            name="customerText"
            autofill="off"
            dataSource={customerFilter}
            fields={CustomerFieldSettings}
            placeholder="Customer"
            value={contractForm ? contractForm.customerText : ""}
            change={onCustomerChange}
            allowFiltering={true}
            filterType={"Contains"}
        />
    div>
  );
};

export default DetailSection;



1 Reply

SN Sevvandhi Nagulan Syncfusion Team January 12, 2021 11:19 AM UTC

Hi Alexies, 


Greetings from Syncfusion support. 


We checked your query. We tried to make the sample using shared code example in react-redux. We are facing couple of issues when making the sample due to dependency mismatch. Please find the screenshot and sample below. 
 

Note: You can run the sample using “npm start” command. 


We tried to resolve the issue by following some common blogs. But the suggested solution does not helps us. 




So please share the issue reproducing local or stackblitz sample. It would be helpful to validate the issue in our end and provide the solution at the earliest. 


Regards, 
Sevvandhi N 


Loader.
Up arrow icon