mirror of
https://github.com/zebrajr/react.git
synced 2026-01-15 12:15:22 +00:00
Merge pull request #5518 from mhujer/docs-spread-fix
Docs: Rest and Spread Properties - ECMAScript
This commit is contained in:
@@ -49,4 +49,4 @@ You can use this multiple times or combine it with other attributes. The specifi
|
||||
|
||||
## What's with the weird `...` notation?
|
||||
|
||||
The `...` operator (or spread operator) is already supported for [arrays in ES6](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_operator). There is also an ES7 proposal for [Object Rest and Spread Properties](https://github.com/sebmarkbage/ecmascript-rest-spread). We're taking advantage of these supported and developing standards in order to provide a cleaner syntax in JSX.
|
||||
The `...` operator (or spread operator) is already supported for [arrays in ES6](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_operator). There is also an ECMAScript proposal for [Object Rest and Spread Properties](https://github.com/sebmarkbage/ecmascript-rest-spread). We're taking advantage of these supported and developing standards in order to provide a cleaner syntax in JSX.
|
||||
|
||||
@@ -20,7 +20,7 @@ If you don't use JSX, you can use any object helper such as ES6 `Object.assign`
|
||||
React.createElement(Component, Object.assign({}, this.props, { more: 'values' }));
|
||||
```
|
||||
|
||||
The rest of this tutorial explains best practices. It uses JSX and experimental ES7 syntax.
|
||||
The rest of this tutorial explains best practices. It uses JSX and experimental ECMAScript syntax.
|
||||
|
||||
## Manual Transfer
|
||||
|
||||
@@ -132,7 +132,7 @@ var FancyCheckbox = React.createClass({
|
||||
|
||||
Rest properties allow you to extract the remaining properties from an object into a new object. It excludes every other property listed in the destructuring pattern.
|
||||
|
||||
This is an experimental implementation of an [ES7 proposal](https://github.com/sebmarkbage/ecmascript-rest-spread).
|
||||
This is an experimental implementation of an [ECMAScript proposal](https://github.com/sebmarkbage/ecmascript-rest-spread).
|
||||
|
||||
```javascript
|
||||
var { x, y, ...z } = { x: 1, y: 2, a: 3, b: 4 };
|
||||
|
||||
Reference in New Issue
Block a user