You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docs/02.2-jsx-spread.md
+1-20Lines changed: 1 addition & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -49,23 +49,4 @@ You can use this multiple times or combine it with other attributes. The specifi
49
49
50
50
## What's with the weird `...` notation?
51
51
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