Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

React.createElement pass props

var Hello = React.createClass({
    render: function() {
        return <div>Hello {this.props.user.name}</div>;
    }
});

var props = { user: {name: "World"}};
React.render(React.createElement(Hello, props), document.getElementById('container'));
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #pass #props
ADD COMMENT
Topic
Name
8+6 =