简体   繁体   中英

React.js not working on Plunker

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

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM