Answers for "React.createElement pass props"

0

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'));
Posted by: Guest on August-15-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language