Skip to content

Instantly share code, notes, and snippets.

@victorb
Created March 17, 2015 22:19
Show Gist options
  • Select an option

  • Save victorb/353e2ae2f18e8befbbd4 to your computer and use it in GitHub Desktop.

Select an option

Save victorb/353e2ae2f18e8befbbd4 to your computer and use it in GitHub Desktop.

Different instances of React for different areas of a page

https://github.com/mhart/react-server-example/blob/master/server.js#L74-L83

window.header.react (1.1)
window.content.react (1.5)
window.blogpost.react (depending on blogpost, for demos)

window.header.react.render(<Header/>, document.getElementById('header'));
window.content.react.render(<Content/>, document.getElementById('content'));
window.blogpost.react.render(<Blogpost/>, document.getElementById('blogpost'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment