title: React.js - Target container is not a DOM element
body: <p>Trying to render a react component:</p>
  
  <pre><code>var wrapper = document.getElementById('wrapper');
  console.log(wrapper);
  ReactDOM.render(
    React.createElement(components.WrapperComponent),{modules_list:modules_list},wrapper);
  </code></pre>
  
  <p>Gives me:</p>
  
  <blockquote>
    <p>Error: _registerComponent(...): Target container is not a DOM element.</p>
  </blockquote>
  
  <p>I know this error may throw when You try to execute react before the html documentt is properly loaded, but my script tag is located on bottom of the document, just before the end body tag. This may happens also when a name mismatch occurs, but i'm sure the a div with id 'wrapper' exists in my document. When I console.log(wrapper) it gives me the object, it's <strong>not undefined</strong>, so idk why react refuses to render it.</p>
  
  <p>ps: I'm "importing" the react component with RequireJS require function:</p>
  
  <pre><code>requirejs(['jsx!layout/WrapperComponent'], function (WrapperComponent) {
          components.WrapperComponent = WrapperComponent;
          render();
      });
  </code></pre>
  
  <p>Then the render() funct is trying to render as exposed above.</p>
  
  <p>Part of my  html doc:</p>
  
  <pre><code>&lt;body class="navbar-top has-detached-right"&gt;
  
      &lt;div id='wrapper'&gt; .... &lt;/div&gt;
  </code></pre>