title: How do I prerender a namespaced react component using the react-rails gem?
body: <p>(Note: I'm using the 'therubyracer', 'react-rails', and 'sprockets-coffee-react' gems)</p>
  
  <p>This is the code for my simple component (Hello.js.cjsx):</p>
  
  <pre><code># @cjsx React.DOM
  
  Hello = React.createClass(
    render: -&gt;
      &lt;div&gt;
        Hello {@props.name || "World"}!
      &lt;/div&gt;
  )
  
  window.components ?= {}
  window.components.Hello = Hello
  </code></pre>
  
  <p>In my rails view (index.html.erb) this works just fine:</p>
  
  <pre><code>&lt;%= render_component('components.Hello', {name: 'Jack'}) %&gt;
  </code></pre>
  
  <p>However, when I try this:</p>
  
  <pre><code>&lt;%= react_component('components.Hello', {name: 'Jill'}, {prerender: true}) %&gt;
  </code></pre>
  
  <p>I get this error:</p>
  
  <p><code>Encountered error "ReferenceError: components is not defined"</code></p>
  
  <p>which seems odd because I'm defining it in my component.</p>
  
  <p>What am I doing wrong?</p>