0

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

1 Answers1

1

As the release notes on 0.14 say they are now two separate packages: https://facebook.github.io/react/blog/2015/10/07/react-v0.14.html

var React = require('react');
var ReactDOM = require('react-dom');
Dominic
  • 62,658
  • 20
  • 139
  • 163