I am getting error shown in image for the below code:
handlechange(event) {
this.setState (prevState => {
return(
checked : !prevState.checked
);});
}
But when I changes round brackets after "return" into curly, it runs fine. I mean what's happening under the hood? What causes the error to go away?
handlechange(event) {
this.setState (prevState => {
return{
checked : !prevState.checked
}});
}
