I am facing issue around with React.js for the first time and cannot find a way to show or hide something on a page via click.
I am not loading any other library to the page, so I am looking for some native way using the React library. This is what I have so far. I would like to show the results div when the click event fires.
Any help appreciated
var Detail = React.createClass({
handleClick: function (event) {
console.log(this.prop);
},
render: function () {
return (
<div className="date-range">
<input type="submit" value="Search" onClick={this.handleClick} />
</div>
);
}
});
var DataRes = React.createClass({
render: function () {
return (
<div id="data" className="search-results">
Some Data
</div>
);
}
});
React.renderComponent(<Detail /> , document.body);