React.js not working on Plunker

- 1 answer

Ad

I'm setting up a very simple React.js Plunker which does not seem to be working. My expectation is that the button should display. Can anyone help out and let me know what is wrong?

http://plnkr.co/edit/dGn5tJx4UbD1yXX0Q3vW?p=preview

var Button = React.createClass({
  render: function() {
    return: (
        <button>Test</button>
      )
  }
});

React.render(<Button />, document.getElementById("root"));

Thanks

Ad

Answer

Ad

Your code has a colon after the return statement, which is causing it to throw a syntax error:

return:

Here's an updated/fixed plunkr.

Ad
source: stackoverflow.com
Ad