Skip to content

Instantly share code, notes, and snippets.

@johnHackworth
Created August 10, 2015 08:43
Show Gist options
  • Select an option

  • Save johnHackworth/fb7e44bc3e3c3995c53d to your computer and use it in GitHub Desktop.

Select an option

Save johnHackworth/fb7e44bc3e3c3995c53d to your computer and use it in GitHub Desktop.
react example
React.createClass({
toggle: function() {
this.setState({
isWhatever: !! this.state.isWhatever
})
}
render: function() {
var activeClasses = classNames( {
'component1': true,
'isWhatever': this.state.whatever
} );
return (
<div onClick={ this.toggle } className={ activeClasses }> blabla </div>
);
}
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment