Answers for "passing function to setstate"

1

passing function to setstate

//use this when current value of state depends on prevstate value For eg. toggle
this.setState(function(prevState){
    return {show: !prevState.showForm}
});
Posted by: Guest on November-07-2020

Code answers related to "passing function to setstate"

Browse Popular Code Answers by Language