Tuesday, 31 January 2017

// // Leave a Comment

Explain what is Prop?

When we use our defined components, we can add attributes called props. These attributes are available in our component as this.props and can be used in our render method to render dynamic data.
var MyComponent = React.createClass({
    render: function(){
        return (
            <h1>Hello, {this.props.name}!</h1>
        );
    }
});

0 comments:

Post a Comment