I\'d like to know how to toggle a boolean state of a react component. For instance:
I have boolean state check in the constructor of my component:
const
I found this the most simple when toggling boolean values. Simply put if the value is already true then it sets it to false and vice versa. Beware of undefined errors, make sure your property was defined before executing
this.setState({ propertyName: this.propertyName = !this.propertyName });