Manage your whole body in reactions

I have a responsive component that controls the entire application in a reaction. It looks like this:

var Page = React.createClass({ displayName: 'Page', render: function() { return ( React.DOM.div(null /*, stuff here ..*/ ) ); } }); 

And the html looks like

 <body id="content"></body> 

And I do it like:

 React.renderComponent(Page(null), document.getElementById('content')); 

But instead, I would react to managing the entire body tag, so there is no redundant nested div . How can i do this?

+6
source share
1 answer

I'm not quite sure that this is what you are asking for, but you can run

 React.renderComponent(Page(null), document.body); 

to install the component directly into the body.

+17
source

All Articles