constructor(props) { super(props); this.state = { isActive: true, }; } checkStatus = () => { this.setState({ // use this function 'isActive' : !this.state.isActive, }); }
componentDidMount()