I am new to reactjs and flux and am trying to create an app. i have this code in my app component.
var App = React.createClass({
handleClick1: function() {
AppActions.addItem('this is the first item');
},
handleClick2: function() {
AppActions.addItem('this is the second item');
},
handleClick3: function() {
AppActions.addItem('this is the third item');
},
render: function() {
return (
<div className="wrapper">
<button it="buttonOne" type="button" onClick={this.handleClick1}>I will display item 1!</button>
<button type="button" onClick={this.handleClick2}>I will display item 2!</button>
<button type="button" onClick={this.handleClick3}>I will display item 3!</button>
{/* <h3 onClick={this.handleClick}>Click this Title, then check console</h3> --> */}
<p> hello </p>
</div>
)
}
});
module.exports = App;
I want to add something like this code:
ReactDOM.render(
<CommentBox />,
document.getElementById('wrapper')
);
but it comes up saying unresolved variable or type ReactDOM
so I guess this question comes with 2 parts.
1) how do you know how to use ReactDOM and when 2) how can i make something appear in the browser i.e where my p
tags are because currently it just appears in the console