<div id='container'></div>
var WithLink = React.createClass({
mixins: [React.addons.LinkedStateMixin],
getInitialState: function() {
return {expanded: false};
},
render: function() {
var details = <p>Detailed description of the product</p>
return (
<div>
<input type="checkbox" id="c-details" checkedLink={this.linkState('expanded')} />
<label for="c-details">Show Details</label>
{ this.state.expanded ? details : false }
</div>
);
}
});
React.render(<WithLink />, document.getElementById('container'));
View Compiled
This Pen doesn't use any external CSS resources.