title: Create an instance of a React class from a string
body: <p>I have a string which contains a name of the Class (this is coming from a json file). This string tells my Template Class which layout / template to use for the data (also in json). The issue is my layout is not displaying.</p>
  
  <p>Home.jsx:</p>
  
  <pre><code>//a template or layout.
  var Home = React.createClass({
    render () {
      return (
      &lt;div&gt;Home layout&lt;/div&gt;
      )
    }
  });
  </code></pre>
  
  <p>Template.jsx:</p>
  
  <pre><code>var Template = React.createClass({
    render: function() {
      var Tag = this.props.template; //this is the name of the class eg. 'Home'
      return (
          &lt;Tag /&gt;
      );
    }
  });
  </code></pre>
  
  <p>I don't get any errors but I also don't see the layout / Home Class. I've checked the props.template and this logs the correct info. Also, I can see the home element in the DOM. However it looks like this:</p>
  
  <pre><code>&lt;div id='template-holder&gt;
      &lt;home&gt;&lt;/home&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>If I change following line to:</p>
  
  <pre><code>var Tag = Home;
  //this works but it's not dynamic!
  </code></pre>
  
  <p>Any ideas, how I can fix this? I'm sure it's either simple fix or I'm doing something stupid. Help would be appreciated. Apologies if this has already been asked (I couldn't find it).</p>
  
  <p>Thanks,
  Ewan</p>