I have a react ponent manages the entire app in react. It looks like:
var Page = React.createClass({
displayName: 'Page',
render: function() {
return (
React.DOM.div(null
/*, stuff here ..*/
)
);
}
});
And html looks like
<body id="content"></body>
And I render it like:
React.renderComponent(Page(null), document.getElementById('content'));
But instead, I would like react to manage the entire body
tag, so there is no redundant nested div
. How can I render such a thing?
I have a react ponent manages the entire app in react. It looks like:
var Page = React.createClass({
displayName: 'Page',
render: function() {
return (
React.DOM.div(null
/*, stuff here ..*/
)
);
}
});
And html looks like
<body id="content"></body>
And I render it like:
React.renderComponent(Page(null), document.getElementById('content'));
But instead, I would like react to manage the entire body
tag, so there is no redundant nested div
. How can I render such a thing?
1 Answer
Reset to default 17I'm not pletely sure if this is what you're asking, but you can run
React.renderComponent(Page(null), document.body);
to mount a ponent directly into body.