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
|
### 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({
|
||||||
|
|
Loading…
Reference in New Issue