Skip to content

Commit bfaddf4

Browse files
committed
Merge pull request #2636 from zpao/docs/spread-assign-update
[docs] Remove generic spread, Object.assign mentions
1 parent 5dd855c commit bfaddf4

File tree

1 file changed

+1
-20
lines changed

1 file changed

+1
-20
lines changed

docs/docs/02.2-jsx-spread.md

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -49,23 +49,4 @@ You can use this multiple times or combine it with other attributes. The specifi
4949

5050
## What's with the weird `...` notation?
5151

52-
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).
53-
54-
In fact, you can already use this in our code base as an experimental syntax:
55-
56-
```javascript
57-
var oldObj = { foo: 'hello', bar: 'world' };
58-
var newObj = { ...oldObj, foo: 'hi' };
59-
console.log(newObj.foo); // 'hi';
60-
console.log(newObj.bar); // 'world';
61-
```
62-
63-
Merging two objects can be expressed as:
64-
65-
```javascript
66-
var ab = { ...a, ...b };
67-
```
68-
69-
> Note:
70-
>
71-
> Use the [JSX command-line tool](http://npmjs.org/package/react-tools) with the `--harmony` flag to activate the experimental ES7 syntax.
52+
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.

0 commit comments

Comments
 (0)