Skip to content

Instantly share code, notes, and snippets.

@leslie-alldridge
Created December 16, 2018 17:49
Show Gist options
  • Save leslie-alldridge/8022d709c47b1d5fdc6ac3915f298759 to your computer and use it in GitHub Desktop.
Save leslie-alldridge/8022d709c47b1d5fdc6ac3915f298759 to your computer and use it in GitHub Desktop.
handlePageChange = (name) => {
Object.keys(this.state).map(
i => i === name ? this.setState({[name]: true}) : this.setState({[i]: false}))
}
goBack = () => {
Object.keys(this.state).map(
i => this.setState({ [i]: true }))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment