Reputation: 1068
i am using react in ES5 syntax, but i a getting a weird behavior
TestCom = React.createClass( {render: function() {return React.createElement('div', null, ['asdasd']) }} )
ReactDOM.render(React.createElement('TestCom', {}), document.getElementById('matches'));
will output
<testcomp data-reactroot=""></testcomp>
what am i missing ?
thank you
Upvotes: 0
Views: 124
Reputation: 10873
You need to pass the component itself, not its name:
ReactDOM.render(React.createElement(TestCom, {}), document.getElementById('matches'));
Upvotes: 1