The list of classes can be derive from the state of the component. For example:
var Component = React.createClass({
getInitialState: function() {
return {
clicked: false
};
},
handleClick: function() {
this.setState({clicked: true});
},
render: function() {
var className = this.state.clicked ? 'click-state' : 'base-state';
return <div className={className} onClick={this.handleClick}>click here</div>;
}
});
Calling this.setState will trigger a rerender of the component.