I created a react class based form, in which i have a checkbox which is dependent on another react component value. Whenever there is change in dropdown value selected by user an internal API is called for enabling/disabling checkbox. Checkbox rendering happens with each change in form i need to restrict it to drop down element and avoid multiple calls.
Earlier i placed the code for identifying if the checkbox to be disabled/enable inside render method but to avoid multiple calls i want to move it outside render(). How to do it in react lifecycle can anyone please help!!!
NOTE: I was returning a dispatch function with action type in old implementation, do i need to get rid of dispatch ?