Skip to content

Instantly share code, notes, and snippets.

@PabloRegen
Last active March 4, 2019 23:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PabloRegen/8af49b27799ee3d8a3506703a0487d20 to your computer and use it in GitHub Desktop.
Save PabloRegen/8af49b27799ee3d8a3506703a0487d20 to your computer and use it in GitHub Desktop.
Start/Stop button
class App extends Component {
state = {...};
runStopButton = () => {
return this.state.isGameRunning ?
<button type='button' onClick={this.handleStop}>Stop</button> :
<button type='button' onClick={this.handleRun}>Start</button>;
}
// Other methods ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment