Pomodoro timer in React
You can replace


&lt;button onClick={this.toogleWork}&gt;Work&lt;/button&gt;
&lt;button onClick={this.toogleRelax}&gt;Relax&lt;/button&gt;



with

&lt;button onClick={this.toggleState}&gt;{this.state.work? 'Relax' : 'Work'}&lt;/button&gt;;


and


toogleWork = () =&gt; this.setState({work: true})
toogleRelax = () =&gt; this.setState({work: false})



with

toggleState = () =&gt; this.setState(prevState =&gt; ({work: !prevState.work}));