title: How to pass a React component (or raw html) into other React component and insert it?
body: <p>I have raw html markup returned from ajax. Rendering raw html is not easy in React. I tried to use their <code>dangerouslySetInnerHTML</code> up and down but no go, only errors are thrown from React. That <code>dangerouslySetInnerHTML</code> is truly obscure.</p>
  
  <p>So I decided to compile my raw html to a React component and insert it. Raw html is compiled to React component all right but I cannot insert it. Here is my code. I want to pass <code>&lt;Html /&gt;</code> component (or raw html would be even better) to <code>&lt;Tr /&gt;</code> component as <code>this.props.b</code>:</p>
  
  <pre><code>var FooComponent = React.createClass({
      render: function() {
              var Html = React.createClass({
                  render: function() {
                      return (
                          myRawHtmlMarkup
                      );
                  }
              });
  
          return (
              &lt;Tr id={key} a={value} b={Html} /&gt;
          );
      }
  });
  </code></pre>
  
  <p>Now how to insert either raw html or <code>&lt;Html /&gt;</code> into DOM <code>&lt;td&gt;</code> element? Using <code>{this.props.b}</code> doesn't work.</p>
  
  <p>And the inportant thing here is that I cannot change <code>this.props.b</code> to smth else like <code>this.props.child</code>, <code>this.props.children</code>, etc. I need that <code>this.props.b</code> because there is a loop in parent <code>FooComponent</code> component and I assign values to <code>this.props.b</code> using many <code>if/else</code> conditions (not shown above for the sake of simplicity):</p>
  
  <pre><code>var Tr = React.createClass({
      render: function() {
          return (
              &lt;tr&gt;
                  &lt;td className="idCol"&gt;{this.props.id}&lt;/td&gt;
                  &lt;td className="aCol"&gt;{this.props.a}&lt;/td&gt;
                  &lt;td className="bCol"&gt;{this.props.b}&lt;/td&gt;
              &lt;/tr&gt;
          );
      }
  });
  </code></pre>