Browse Source

Merge pull request #2921 from hanski07/updateTransferringPropsDocs

Update transferring props docs
main
Jim 10 years ago
parent
commit
fefcc0a5c4
  1. 4
      docs/06-transferring-props.md

4
docs/06-transferring-props.md

@ -49,6 +49,10 @@ But what about the `name` prop? Or the `title` prop? Or `onMouseOver`?
## Transferring with `...` in JSX
> NOTE:
>
> In the example below, the `--harmony ` flag is required as this syntax is an experimental ES7 syntax. If using the in-browser JSX transformer, simply open your script with `<script type="text/jsx;harmony=true">`. See the [Rest and Spread Properties ...](http://facebook.github.io/react/docs/transferring-props.html#rest-and-spread-properties-...) section below for more details.
Sometimes it's fragile and tedious to pass every property along. In that case you can use [destructuring assignment](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment) with rest properties to extract a set of unknown properties.
List out all the properties that you would like to consume, followed by `...other`.

Loading…
Cancel
Save