Why react uses setState twice in a function (the second time in settimeou) why it still merges execution.

I want to do one to prevent repeated clicks, but now isClickable can"t be set to false, to comment out settimeout. Of course, after adding normal disable, disable becomes invalid. -sharp-sharp-sharp problem description

the environmental background of the problems and what methods you have tried

related codes

/ / Please paste the code text below (do not replace the code with pictures)

handleButtonClickTest = (hireTeamId) = > {

this.props.actions.deleteHiringTeamMember(hireTeamId);
this.setState({
  isClickable: false,
});
setTimeout(this.setState({ isClickable: true }), 5000);

}

what result do you expect? What is the error message actually seen?

Dec.01,2021

setTimeout should be written

  

I suggest that this variable be global. You don't have to put state, because setState is an asynchronous function, so you can assign a value directly if it is global.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b36f7c-2c084.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b36f7c-2c084.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?