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