Skip to content

Instantly share code, notes, and snippets.

@christiannwamba
Created May 30, 2018 14:54
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 christiannwamba/40ad466f3753e4b8f325ef00b93e7075 to your computer and use it in GitHub Desktop.
Save christiannwamba/40ad466f3753e4b8f325ef00b93e7075 to your computer and use it in GitHub Desktop.
// ...
class Hamburger extends Component {
constructor(props) {
super(props);
this.state = {
toggleState: 0
};
this.handleClick = this.handleClick.bind(this);
}
handleClick() {
this.refs.container.classList.toggle('change');
this.setState({
toggleState: this.state.toggleState ? 0 : 1
});
}
}
// ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment