You have the right idea - but in a class there is only one render method. Your logic does belong inside the render. This should do what you're looking for:
class Flicker extends React.Component { constructor(props){ super(props); this.state = {mode: "On"}; } flipOn(){ this.setState({mode: "On"}) } flipOff(){ this.setState({mode: "Off"}) } render () { return (<button onClick={(this.state.mode === 'Off') ? this.flipOn : this.flipOff}>State: {this.state.mode}</button> ) }}export default Flicker;