title: React.js: Passing nested props into React.createElement
body: <p>I have code of the form</p>
  
  <pre><code>props = { user: {userattr1: 1, userattr2: 2}};
  var element = React.createElement(MyReactClass, props);
  </code></pre>
  
  <p>i.e., where props is a <em>nested object</em>. When I try to compile the above code I get the error: </p>
  
  <p>Warning: Any use of a keyed object should be wrapped in React.addons.createFragment(object) before being passed as a child.</p>
  
  <p>I've been looking online and it seems that nested objects are perfectly permissible as props. How can I resolve my error?</p>
  
  <p>Edit: <code>MyReactClass</code> looks something like this:</p>
  
  <pre><code>var MyReactClass = React.createClass({
    render: function () {
      &lt;div&gt;{this.props.user}&lt;/div&gt;
    }
  })
  </code></pre>