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
var CheckLink = React.createClass({
var VideoPlayer = React.createClass({
render: function() {
// transferPropsTo() will take any props passed to CheckLink
// and copy them to <a>
return this.transferPropsTo(<a>{'√ '}{this.props.children}</a>);
return <VideoEmbed {...this.props} controls='false' />;
}
});
<VideoPlayer src="video.mp4" />
### Mixins
var TickTock = React.createClass({