Put the conditional logic inside the render() method.
Something like this...
class Example extends React.Component { // the rest of your code render() { const { mode } = this.state; return(<div> {mode ==="on"&& <button onClick={this.flipOn}>State: On</button> } {mode === "off"&& <button onClick={this.flipOff}>State: Off</button>}</div> ) }}