can i pass a function to this.setsta code example
Example: 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}
});
//use this when current value of state depends on prevstate value For eg. toggle
this.setState(function(prevState){
return {show: !prevState.showForm}
});