Skip to content

Instantly share code, notes, and snippets.

@PabloRegen
Last active March 5, 2019 00:00
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/59e455459abc2c078c23877726843789 to your computer and use it in GitHub Desktop.
Save PabloRegen/59e455459abc2c078c23877726843789 to your computer and use it in GitHub Desktop.
Clear board and new board methods
class App extends Component {
state = {...};
runStopButton = () => {...}
handleClearBoard = () => {
this.setState({
boardStatus: newBoardStatus(() => false),
generation: 0
});
}
handleNewBoard = () => {
this.setState({
boardStatus: newBoardStatus(),
generation: 0
});
}
// More methods ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment