Update transferPropsTo with spread operator
This commit is contained in:
parent
91738c082d
commit
226cd6c430
8
react.md
8
react.md
|
@ -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({
|
||||
|
|
Loading…
Reference in New Issue