Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
71
rated 0 times [  74] [ 3]  / answers: 1 / hits: 6523  / 11 Years ago, mon, january 13, 2014, 12:00:00

I have a react component 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?


More From » reactjs

 Answers
3

I'm not completely sure if this is what you're asking, but you can run



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


to mount a component directly into body.


[#48744] Sunday, January 12, 2014, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
aidan

Total Points: 72
Total Questions: 95
Total Answers: 121

Location: Uzbekistan
Member since Sat, Feb 27, 2021
3 Years ago
;