React.js not working on Plunker
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
Related Questions
Ad
- → Import statement and Babel
- → should I choose reactjs+f7 or f7+vue.js?
- → Uncaught TypeError: Cannot read property '__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED' of undefined
- → .tsx webpack compile fails: Unexpected token <
- → React-router: Passing props to children
- → ListView.DataSource looping data for React Native
- → React Native with visual studio 2015 IDE
- → Can't test submit handler in React component
- → React + Flux - How to avoid global variable
- → Webpack, React & Babel, not rendering DOM
- → How do I determine if a new ReactJS session and/or Browser session has started?
- → Alt @decorators in React-Native
- → How to dynamically add class to parent div of focused input field?
Ad