var MyComponentClass = React.createClass({ render: function () { return <h1>Hello world</h1>; } }); ReactDOM.render( <MyComponentClass />, document.getElementById('app') );
So, I have been following some tutorials on ReactJS and I am having a hard time understanding what exactly is going on under the hood of React, especially the above piece of code.
Like, what exactly is the need for the render method inside the createClass method of React's library?
How does the render method get called when ReactDOM.render is called?
I have tried looking through the documentation of ReactJS, but I ran into the same problem where there is no explanation of what is going on underneath the hood. Tried googling the problem, same result. Questions seem to be based around how to do it, rather than what it actually does.
Even if someone could point me in the direction of the right area of the docs, that would help me immensely.