From 50c8e71ae96d2d0019a594c6597e41bf6db8f8b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20O=E2=80=99Shannessy?= Date: Mon, 1 Dec 2014 13:54:26 -0800 Subject: [PATCH] [docs] Remove generic spread, Object.assign mentions --- docs/02.2-jsx-spread.md | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/docs/02.2-jsx-spread.md b/docs/02.2-jsx-spread.md index ca212bcf..76597d59 100644 --- a/docs/02.2-jsx-spread.md +++ b/docs/02.2-jsx-spread.md @@ -49,23 +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). - -In fact, you can already use this in our code base as an experimental syntax: - -```javascript - var oldObj = { foo: 'hello', bar: 'world' }; - var newObj = { ...oldObj, foo: 'hi' }; - console.log(newObj.foo); // 'hi'; - console.log(newObj.bar); // 'world'; -``` - -Merging two objects can be expressed as: - -```javascript - var ab = { ...a, ...b }; -``` - -> Note: -> -> Use the [JSX command-line tool](http://npmjs.org/package/react-tools) with the `--harmony` flag to activate the experimental ES7 syntax. +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.