Tuesday, 31 January 2017

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>
        );
    }
});

WHAT OTHERS ARE READING/RELATED TO THIS:

0 comments:

Post a Comment

Find job here...