Sending Component Props
Keep in mind anywhere a component is used a property can be sent to it. For example, the code from the previous section demonstrates the use of the Badge
component and name
property from within the BadgeList
component.
var Badge = React.createClass({
return <div>{this.props.name}</div>;
}
var BadgeList = React.createClass({
render: function() {
return (<div>
</div>);
}
});
ReactDOM.render(<BadgeList />, document.getElementById('app'));