title: Dynamically insert react components into another react component
body: <p>Right now I have a sidebar that I want to use for various forms and bits of information. I'm using the global event system to trigger the opening of the sidebar, but I'm not sure how to inject react components into the sidebar react component. </p>
  
  <p>I started by trying this</p>
  
  <pre><code>componentWillMount: -&gt;
    window.toggleSidebar = (react_component)=&gt;
      React.renderComponent(react_component(), document.getElementById('sidebar-content'))
      @toggleSidebar()
  </code></pre>
  
  <p>But this didn't work once all of the components are mounted because you can't call render component into an element that is inside another component.</p>
  
  <p>So is there an accepted way to pass any react component into another component?</p>