Update transferPropsTo with spread operator

This commit is contained in:
Rico Sta. Cruz 2015-02-25 17:59:56 +08:00
parent 91738c082d
commit 226cd6c430
1 changed files with 4 additions and 4 deletions

View File

@ -141,14 +141,14 @@ layout: default
### Propagating properties to children ### Propagating properties to children
var CheckLink = React.createClass({ var VideoPlayer = React.createClass({
render: function() { render: function() {
// transferPropsTo() will take any props passed to CheckLink return <VideoEmbed {...this.props} controls='false' />;
// and copy them to <a>
return this.transferPropsTo(<a>{'√ '}{this.props.children}</a>);
} }
}); });
<VideoPlayer src="video.mp4" />
### Mixins ### Mixins
var TickTock = React.createClass({ var TickTock = React.createClass({