javascript - Render components inside other components with react.js -


i'm having trouble figuring out how render react components, children inside other components on serverside. on client side in index.js file i'd like:

react.render(   <panel title="full time score">     <graph />   </panel>, document.getelementbyid('column-main')  ); 

but on server side i'm not getting luck, possible this? or kind of anti-pattern , should start off 1 parent component.

what i'm trying have reusable panel component (it includes button toggles visibility) can put content/components inside.

on server, markup returned react.{rendertostring,rendertostaticmarkup} html output of component on first render. on client, components can re-render after componentdidmount lifecycle method has fired.

make sure panel component renders children prop on first render.


Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -