0

I have something like this. I am calling _onButtonClickDryRun on clicking a button, which inturn calls another function on being clicked. In first function I am changing the state and in second function I want to use the changed state. However I see that _onafterButtonClick does not see the effect of the new state changed by this.setState statement

_onButtonClickDryRun = (data) => {
    this.setState({
      name: data.name,
    });
  this._onafterButtonClick(true); 
  };

_onafterButtonClick = (isDryRun: boolean) => {
 //makes use of this.state.name;
}
danish sodhi
  • 1,793
  • 4
  • 21
  • 31

0 Answers0