From 3292248ff0bb85935e157ddfc8e0ea035990e1e0 Mon Sep 17 00:00:00 2001 From: Joe Lim Date: Sat, 7 Oct 2017 09:28:28 -0700 Subject: [PATCH 01/43] add shorthand for specifying pixel values in style props to docs --- content/docs/reference-dom-elements.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/content/docs/reference-dom-elements.md b/content/docs/reference-dom-elements.md index 025cf3dd..70db2469 100644 --- a/content/docs/reference-dom-elements.md +++ b/content/docs/reference-dom-elements.md @@ -88,6 +88,18 @@ function ComponentWithTransition() { Style keys are camelCased in order to be consistent with accessing the properties on DOM nodes from JS (e.g. `node.style.backgroundImage`). Vendor prefixes [other than `ms`](http://www.andismith.com/blog/2012/02/modernizr-prefixed/) should begin with a capital letter. This is why `WebkitTransition` has an uppercase "W". +When specifying a pixel value for your inline style prop, React automatically appends the string "px" for you after your number value, so this works: + +```js +const divStyle = { + height: 10 // rendered as "height:10px" +}; + +function HelloWorldComponent() { + return
Hello World!
; +} +``` + ### suppressContentEditableWarning Normally, there is a warning when an element with children is also marked as `contentEditable`, because it won't work. This attribute suppresses that warning. Don't use this unless you are building a library like [Draft.js](https://facebook.github.io/draft-js/) that manages `contentEditable` manually. From b0db2aad22ab69e122769c97248c04b154b90ab0 Mon Sep 17 00:00:00 2001 From: Joe Lim Date: Sun, 8 Oct 2017 13:47:05 -0700 Subject: [PATCH 02/43] include notes on unitless props --- content/docs/reference-dom-elements.md | 30 ++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/content/docs/reference-dom-elements.md b/content/docs/reference-dom-elements.md index 70db2469..de87c278 100644 --- a/content/docs/reference-dom-elements.md +++ b/content/docs/reference-dom-elements.md @@ -99,6 +99,36 @@ function HelloWorldComponent() { return
Hello World!
; } ``` +Sometimes you _do_ want to keep the CSS properties unitless. Here's a list of properties that won't get the automatic "px" suffix: + +- `animationIterationCount` +- `boxFlex` +- `boxFlexGroup` +- `boxOrdinalGroup` +- `columnCount` +- `fillOpacity` +- `flex` +- `flexGrow` +- `flexPositive` +- `flexShrink` +- `flexNegative` +- `flexOrder` +- `fontWeight` +- `lineClamp` +- `lineHeight` +- `opacity` +- `order` +- `orphans` +- `stopOpacity` +- `strokeDashoffset` +- `strokeOpacity` +- `strokeWidth` +- `tabSize` +- `widows` +- `zIndex` +- `zoom` + +See [unitless properties](https://github.com/facebook/react/blob/4131af3e4bf52f3a003537ec95a1655147c81270/src/renderers/dom/shared/CSSProperty.js#L15-L59) for more examples. ### suppressContentEditableWarning From b333f92d765b9128c9465aaa636f9652c7c5edca Mon Sep 17 00:00:00 2001 From: Joe Lim Date: Sun, 8 Oct 2017 13:49:23 -0700 Subject: [PATCH 03/43] fix minor formatting issue --- content/docs/reference-dom-elements.md | 1 + 1 file changed, 1 insertion(+) diff --git a/content/docs/reference-dom-elements.md b/content/docs/reference-dom-elements.md index de87c278..aeacd66d 100644 --- a/content/docs/reference-dom-elements.md +++ b/content/docs/reference-dom-elements.md @@ -99,6 +99,7 @@ function HelloWorldComponent() { return
Hello World!
; } ``` + Sometimes you _do_ want to keep the CSS properties unitless. Here's a list of properties that won't get the automatic "px" suffix: - `animationIterationCount` From 6dad6d2b7a32bb03ee50e0bc783d9b364ab8de96 Mon Sep 17 00:00:00 2001 From: sw-yx Date: Sun, 8 Oct 2017 14:34:03 -0400 Subject: [PATCH 04/43] added documentation for passing arguments to event handlers --- content/docs/handling-events.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/content/docs/handling-events.md b/content/docs/handling-events.md index e1ea2d3c..38b985ee 100644 --- a/content/docs/handling-events.md +++ b/content/docs/handling-events.md @@ -139,3 +139,17 @@ class LoggingButton extends React.Component { ``` The problem with this syntax is that a different callback is created each time the `LoggingButton` renders. In most cases, this is fine. However, if this callback is passed as a prop to lower components, those components might do an extra re-rendering. We generally recommend binding in the constructor or using the class fields syntax, to avoid this sort of performance problem. + +## Passing arguments to event handlers + +Inside a loop it is common to want to pass a param to an event handler. For example if `i` is the row id: + +```js + +``` + +or alternatively (especially if you want to avoid triggering a re-render in a child component): + +```js + +``` From bbabe69bf249e11bd0949a835bb3e01d9be92737 Mon Sep 17 00:00:00 2001 From: jxom Date: Mon, 9 Oct 2017 20:58:52 +1100 Subject: [PATCH 05/43] Add script for check-all in CI --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 13be6a02..831205c4 100644 --- a/package.json +++ b/package.json @@ -68,11 +68,12 @@ }, "scripts": { "build": "gatsby build", - "check-all": "yarn prettier && yarn lint && yarn flow", + "check-all": "yarn prettier -- --write && yarn lint && yarn flow", + "check-all:verbose": "yarn prettier -- --list-different && yarn lint && yarn flow", "dev": "gatsby develop -H 0.0.0.0", "lint": "eslint .", "netlify": "yarn install && yarn build", - "prettier": "prettier --config .prettierrc --write '{flow-typed,plugins,src}/**/*.js'", + "prettier": "prettier --config .prettierrc '{flow-typed,plugins,src}/**/*.js'", "reset": "rimraf ./.cache" }, "devDependencies": { From d26cf5f86c7ad01893c44efea7f035e29fd2cf7b Mon Sep 17 00:00:00 2001 From: jxom Date: Mon, 9 Oct 2017 21:04:29 +1100 Subject: [PATCH 06/43] Add prettier:diff script --- package.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 831205c4..8c18ca1b 100644 --- a/package.json +++ b/package.json @@ -68,12 +68,13 @@ }, "scripts": { "build": "gatsby build", - "check-all": "yarn prettier -- --write && yarn lint && yarn flow", - "check-all:verbose": "yarn prettier -- --list-different && yarn lint && yarn flow", + "check-all": "yarn prettier && yarn lint && yarn flow", + "check-all:verbose": "yarn prettier:diff && yarn lint && yarn flow", "dev": "gatsby develop -H 0.0.0.0", "lint": "eslint .", "netlify": "yarn install && yarn build", - "prettier": "prettier --config .prettierrc '{flow-typed,plugins,src}/**/*.js'", + "prettier": "prettier --config .prettierrc --write '{flow-typed,plugins,src}/**/*.js'", + "prettier:diff": "prettier --config .prettierrc --list-different '{flow-typed,plugins,src}/**/*.js'", "reset": "rimraf ./.cache" }, "devDependencies": { From 5a96b1da0336ec8ad85b59296896a7fcd501c7e9 Mon Sep 17 00:00:00 2001 From: jxom Date: Tue, 10 Oct 2017 08:22:12 +1100 Subject: [PATCH 07/43] Rename check-all:verbose to ci-check, add some useful eslint config --- .eslintrc | 10 +++++++++- package.json | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.eslintrc b/.eslintrc index 78354d1e..28d87f00 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,7 +1,15 @@ { + "extends": [ + "eslint:recommended", + "plugin:react/recommended" + ], "plugins": [ "prettier", "react" ], "parser": "babel-eslint", -} \ No newline at end of file + "env": { + "node": true, + "browser": true + } +} diff --git a/package.json b/package.json index 8c18ca1b..8541b89c 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,7 @@ "scripts": { "build": "gatsby build", "check-all": "yarn prettier && yarn lint && yarn flow", - "check-all:verbose": "yarn prettier:diff && yarn lint && yarn flow", + "ci-check": "yarn prettier:diff && yarn lint && yarn flow", "dev": "gatsby develop -H 0.0.0.0", "lint": "eslint .", "netlify": "yarn install && yarn build", From f3aea257766603912d3354e9466ca53052992bb7 Mon Sep 17 00:00:00 2001 From: Brian Vaughn Date: Mon, 9 Oct 2017 14:27:13 -0700 Subject: [PATCH 08/43] Wording nits --- content/docs/reference-dom-elements.md | 49 ++++++-------------------- 1 file changed, 11 insertions(+), 38 deletions(-) diff --git a/content/docs/reference-dom-elements.md b/content/docs/reference-dom-elements.md index aeacd66d..fb010ca6 100644 --- a/content/docs/reference-dom-elements.md +++ b/content/docs/reference-dom-elements.md @@ -88,48 +88,21 @@ function ComponentWithTransition() { Style keys are camelCased in order to be consistent with accessing the properties on DOM nodes from JS (e.g. `node.style.backgroundImage`). Vendor prefixes [other than `ms`](http://www.andismith.com/blog/2012/02/modernizr-prefixed/) should begin with a capital letter. This is why `WebkitTransition` has an uppercase "W". -When specifying a pixel value for your inline style prop, React automatically appends the string "px" for you after your number value, so this works: +React will automatically append a "px" suffix to certain inline style properties. For example: ```js -const divStyle = { - height: 10 // rendered as "height:10px" -}; - -function HelloWorldComponent() { - return
Hello World!
; -} +// This: +
+ Hello World! +
; + +// Becomes: +
+ Hello World! +
``` -Sometimes you _do_ want to keep the CSS properties unitless. Here's a list of properties that won't get the automatic "px" suffix: - -- `animationIterationCount` -- `boxFlex` -- `boxFlexGroup` -- `boxOrdinalGroup` -- `columnCount` -- `fillOpacity` -- `flex` -- `flexGrow` -- `flexPositive` -- `flexShrink` -- `flexNegative` -- `flexOrder` -- `fontWeight` -- `lineClamp` -- `lineHeight` -- `opacity` -- `order` -- `orphans` -- `stopOpacity` -- `strokeDashoffset` -- `strokeOpacity` -- `strokeWidth` -- `tabSize` -- `widows` -- `zIndex` -- `zoom` - -See [unitless properties](https://github.com/facebook/react/blob/4131af3e4bf52f3a003537ec95a1655147c81270/src/renderers/dom/shared/CSSProperty.js#L15-L59) for more examples. +Not all style properties are converted to pixel strings though. Certain ones remain unitless (eg `zoom`, `order`, `flex`). A complete list of unitless properties can be seen [here](https://github.com/facebook/react/blob/4131af3e4bf52f3a003537ec95a1655147c81270/src/renderers/dom/shared/CSSProperty.js#L15-L59). ### suppressContentEditableWarning From de3bd87f4b3c5d370fe97e7eb65ef673e002404b Mon Sep 17 00:00:00 2001 From: jxom Date: Tue, 10 Oct 2017 08:41:44 +1100 Subject: [PATCH 09/43] Added fbjs eslint config, fixed lint errors and warnings --- .eslintrc | 7 +++++-- package.json | 6 +++++- .../StickyResponsiveSidebar/StickyResponsiveSidebar.js | 4 +++- src/html.js | 2 +- src/templates/components/MetaTitle/index.js | 4 +++- src/templates/components/Sidebar/Section.js | 1 + src/utils/isItemActive.js | 5 ++--- 7 files changed, 20 insertions(+), 9 deletions(-) diff --git a/.eslintrc b/.eslintrc index 28d87f00..a51454ef 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,13 +1,16 @@ { "extends": [ - "eslint:recommended", - "plugin:react/recommended" + "fbjs" ], "plugins": [ "prettier", "react" ], "parser": "babel-eslint", + "rules": { + "relay/graphql-naming": 0, + "max-len": 0 + }, "env": { "node": true, "browser": true diff --git a/package.json b/package.json index 8541b89c..1d214c9f 100644 --- a/package.json +++ b/package.json @@ -16,10 +16,14 @@ "array-from": "^2.1.1", "babel-eslint": "^8.0.1", "eslint": "^4.8.0", + "eslint-config-fbjs": "^2.0.0", "eslint-config-react": "^1.1.7", - "eslint-plugin-flowtype": "^2.37.0", + "eslint-plugin-babel": "^4.1.2", + "eslint-plugin-flowtype": "^2.39.1", + "eslint-plugin-jsx-a11y": "^6.0.2", "eslint-plugin-prettier": "^2.3.1", "eslint-plugin-react": "^7.4.0", + "eslint-plugin-relay": "^0.0.19", "flow-bin": "^0.56.0", "gatsby": "^1.9.9", "gatsby-link": "^1.6.9", diff --git a/src/components/StickyResponsiveSidebar/StickyResponsiveSidebar.js b/src/components/StickyResponsiveSidebar/StickyResponsiveSidebar.js index d92e6ab9..d2981de3 100644 --- a/src/components/StickyResponsiveSidebar/StickyResponsiveSidebar.js +++ b/src/components/StickyResponsiveSidebar/StickyResponsiveSidebar.js @@ -147,7 +147,9 @@ class StickyResponsiveSidebar extends Component { boxShadow: '0 0 20px rgba(0, 0, 0, 0.3)', [media.lessThan('small')]: smallScreenBottomBarStyles, }} - onClick={this._openNavMenu}> + onClick={this._openNavMenu} + role="button" + tabIndex="-1">
+ }} + role="link" + tabIndex="-1"> {children}
); diff --git a/src/templates/components/Sidebar/Section.js b/src/templates/components/Sidebar/Section.js index 83b9917c..517a89dd 100644 --- a/src/templates/components/Sidebar/Section.js +++ b/src/templates/components/Sidebar/Section.js @@ -9,6 +9,7 @@ 'use strict'; +import React from 'react'; import {colors, media} from 'theme'; import isItemActive from 'utils/isItemActive'; import MetaTitle from '../MetaTitle'; diff --git a/src/utils/isItemActive.js b/src/utils/isItemActive.js index d5e501cd..ad0dfe11 100644 --- a/src/utils/isItemActive.js +++ b/src/utils/isItemActive.js @@ -26,10 +26,9 @@ const isItemActive = (location, item) => { } } else if (item.id.includes('html')) { return location.pathname.includes(item.id); - } else { - const slugId = location.pathname.split('/').slice(-1)[0]; - return slugId === slugify(item.id); } + const slugId = location.pathname.split('/').slice(-1)[0]; + return slugId === slugify(item.id); }; export default isItemActive; From 2255e1efed752e849c0a2fb2533a178bef7dd821 Mon Sep 17 00:00:00 2001 From: Anna Do Date: Mon, 9 Oct 2017 19:11:04 -0400 Subject: [PATCH 10/43] Added a note that mockComponent is legacy and unnecessary --- content/docs/addons-test-utils.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/content/docs/addons-test-utils.md b/content/docs/addons-test-utils.md index fc482e19..3e43023f 100644 --- a/content/docs/addons-test-utils.md +++ b/content/docs/addons-test-utils.md @@ -112,6 +112,10 @@ mockComponent( Pass a mocked component module to this method to augment it with useful methods that allow it to be used as a dummy React component. Instead of rendering as usual, the component will become a simple `
` (or other tag if `mockTagName` is provided) containing any provided children. +> Note: +> +> `mockComponent()` is a legacy method that is no longer needed. A similar method can be implemented directly. + * * * ### `isElement()` From 43c1c007032f0c57ab3b4e8bda66af5ba6112e89 Mon Sep 17 00:00:00 2001 From: hozefaj Date: Mon, 9 Oct 2017 16:11:18 -0700 Subject: [PATCH 11/43] fix links to pure component within docs --- content/blog/2017-04-07-react-v15.5.0.md | 4 ++-- content/docs/addons-pure-render-mixin.md | 2 +- content/docs/addons-shallow-compare.md | 4 ++-- content/docs/addons.md | 2 +- content/docs/reference-pure-render-mixin.md | 2 +- content/docs/reference-react-component.md | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/content/blog/2017-04-07-react-v15.5.0.md b/content/blog/2017-04-07-react-v15.5.0.md index eea84664..7a61d6e8 100644 --- a/content/blog/2017-04-07-react-v15.5.0.md +++ b/content/blog/2017-04-07-react-v15.5.0.md @@ -113,8 +113,8 @@ We're discontinuing active maintenance of React Addons packages. In truth, most - **react-addons-create-fragment** – React 16 will have first-class support for fragments, at which point this package won't be necessary. We recommend using arrays of keyed elements instead. - **react-addons-css-transition-group** - Use [react-transition-group/CSSTransitionGroup](https://github.com/reactjs/react-transition-group) instead. Version 1.1.1 provides a drop-in replacement. - **react-addons-linked-state-mixin** - Explicitly set the `value` and `onChange` handler instead. -- **react-addons-pure-render-mixin** - Use [`React.PureComponent`](/docs/react-api.html#react.purecomponent) instead. -- **react-addons-shallow-compare** - Use [`React.PureComponent`](/docs/react-api.html#react.purecomponent) instead. +- **react-addons-pure-render-mixin** - Use [`React.PureComponent`](/docs/react-api.html#reactpurecomponent) instead. +- **react-addons-shallow-compare** - Use [`React.PureComponent`](/docs/react-api.html#reactpurecomponent) instead. - **react-addons-transition-group** - Use [react-transition-group/TransitionGroup](https://github.com/reactjs/react-transition-group) instead. Version 1.1.1 provides a drop-in replacement. - **react-addons-update** - Use [immutability-helper](https://github.com/kolodny/immutability-helper) instead, a drop-in replacement. - **react-linked-input** - Explicitly set the `value` and `onChange` handler instead. diff --git a/content/docs/addons-pure-render-mixin.md b/content/docs/addons-pure-render-mixin.md index 03cd2e02..c6230586 100644 --- a/content/docs/addons-pure-render-mixin.md +++ b/content/docs/addons-pure-render-mixin.md @@ -8,7 +8,7 @@ category: Add-Ons > Note: > -> `PureRenderMixin` is a legacy add-on. Use [`React.PureComponent`](/docs/react-api.html#react.purecomponent) instead. +> `PureRenderMixin` is a legacy add-on. Use [`React.PureComponent`](/docs/react-api.html#reactpurecomponent) instead. **Importing** diff --git a/content/docs/addons-shallow-compare.md b/content/docs/addons-shallow-compare.md index 8845d387..90f0c1d1 100644 --- a/content/docs/addons-shallow-compare.md +++ b/content/docs/addons-shallow-compare.md @@ -8,7 +8,7 @@ category: Reference > Note: > -> `shallowCompare` is a legacy add-on. Use [`React.PureComponent`](/docs/react-api.html#react.purecomponent) instead. +> `shallowCompare` is a legacy add-on. Use [`React.PureComponent`](/docs/react-api.html#reactpurecomponent) instead. **Importing** @@ -19,7 +19,7 @@ var shallowCompare = require('react-addons-shallow-compare'); // ES5 with npm ## Overview -Before [`React.PureComponent`](/docs/react-api.html#react.purecomponent) was introduced, `shallowCompare` was commonly used to achieve the same functionality as [`PureRenderMixin`](pure-render-mixin.html) while using ES6 classes with React. +Before [`React.PureComponent`](/docs/react-api.html#reactpurecomponent) was introduced, `shallowCompare` was commonly used to achieve the same functionality as [`PureRenderMixin`](pure-render-mixin.html) while using ES6 classes with React. If your React component's render function is "pure" (in other words, it renders the same result given the same props and state), you can use this helper function for a performance boost in some cases. diff --git a/content/docs/addons.md b/content/docs/addons.md index 374bedab..841348da 100644 --- a/content/docs/addons.md +++ b/content/docs/addons.md @@ -21,7 +21,7 @@ The add-ons below are in the development (unminified) version of React only: The add-ons below are considered legacy and their use is discouraged. They will keep working in observable future, but there is no further development. -- [`PureRenderMixin`](pure-render-mixin.html). Use [`React.PureComponent`](/docs/react-api.html#react.purecomponent) instead. +- [`PureRenderMixin`](pure-render-mixin.html). Use [`React.PureComponent`](/docs/react-api.html#reactpurecomponent) instead. - [`shallowCompare`](shallow-compare.html), a helper function that performs a shallow comparison for props and state in a component to decide if a component should update. - [`update`](update.html). Use [`kolodny/immutability-helper`](https://github.com/kolodny/immutability-helper) instead. - [`ReactDOMFactories`](dom-factories.html), pre-configured DOM factories to make React easier to use without JSX. diff --git a/content/docs/reference-pure-render-mixin.md b/content/docs/reference-pure-render-mixin.md index a68357bc..6da08e31 100644 --- a/content/docs/reference-pure-render-mixin.md +++ b/content/docs/reference-pure-render-mixin.md @@ -8,7 +8,7 @@ permalink: docs/pure-render-mixin.html > Note -> The `PureRenderMixin` mixin predates `React.PureComponent`. This reference doc is provided for legacy purposes, and you should consider using [`React.PureComponent`](/docs/react-api.html#react.purecomponent) instead. +> The `PureRenderMixin` mixin predates `React.PureComponent`. This reference doc is provided for legacy purposes, and you should consider using [`React.PureComponent`](/docs/react-api.html#reactpurecomponent) instead. If your React component's render function renders the same result given the same props and state, you can use this mixin for a performance boost in some cases. diff --git a/content/docs/reference-react-component.md b/content/docs/reference-react-component.md index 24d5f6ff..a91183da 100644 --- a/content/docs/reference-react-component.md +++ b/content/docs/reference-react-component.md @@ -204,7 +204,7 @@ Returning `false` does not prevent child components from re-rendering when *thei Currently, if `shouldComponentUpdate()` returns `false`, then [`componentWillUpdate()`](#componentwillupdate), [`render()`](#render), and [`componentDidUpdate()`](#componentdidupdate) will not be invoked. Note that in the future React may treat `shouldComponentUpdate()` as a hint rather than a strict directive, and returning `false` may still result in a re-rendering of the component. -If you determine a specific component is slow after profiling, you may change it to inherit from [`React.PureComponent`](/docs/react-api.html#react.purecomponent) which implements `shouldComponentUpdate()` with a shallow prop and state comparison. If you are confident you want to write it by hand, you may compare `this.props` with `nextProps` and `this.state` with `nextState` and return `false` to tell React the update can be skipped. +If you determine a specific component is slow after profiling, you may change it to inherit from [`React.PureComponent`](/docs/react-api.html#reactpurecomponent) which implements `shouldComponentUpdate()` with a shallow prop and state comparison. If you are confident you want to write it by hand, you may compare `this.props` with `nextProps` and `this.state` with `nextState` and return `false` to tell React the update can be skipped. * * * From 592c3838b8c3ff5758e4d302d8ef07bccb8115bc Mon Sep 17 00:00:00 2001 From: Anna Do Date: Mon, 9 Oct 2017 19:17:57 -0400 Subject: [PATCH 12/43] Noted that a similar pattern can be implemented directly --- content/docs/addons-test-utils.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/docs/addons-test-utils.md b/content/docs/addons-test-utils.md index 3e43023f..7552a1d9 100644 --- a/content/docs/addons-test-utils.md +++ b/content/docs/addons-test-utils.md @@ -114,7 +114,7 @@ Pass a mocked component module to this method to augment it with useful methods > Note: > -> `mockComponent()` is a legacy method that is no longer needed. A similar method can be implemented directly. +> `mockComponent()` is a legacy method that is no longer needed. A similar pattern can be implemented directly. * * * From 192fca8a43d0f9e1394239f02f010856ed0cb0f2 Mon Sep 17 00:00:00 2001 From: Tommy Graves Date: Mon, 9 Oct 2017 19:35:38 -0400 Subject: [PATCH 13/43] Clarifies the behavior of test renderer's find methods --- content/docs/reference-test-renderer.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/docs/reference-test-renderer.md b/content/docs/reference-test-renderer.md index 75f75f01..9e463400 100644 --- a/content/docs/reference-test-renderer.md +++ b/content/docs/reference-test-renderer.md @@ -158,7 +158,7 @@ Returns the root "test instance" object that is useful for making assertions abo testInstance.find(test) ``` -Find the first descendant test instance for which `test(testInstance)` returns `true`. +Find the only descendant test instance for which `test(testInstance)` returns `true`. If `test(testInstance)` does not return `true` for exactly one test instance, it will throw an error. ### `testInstance.findByType()` @@ -166,7 +166,7 @@ Find the first descendant test instance for which `test(testInstance)` returns ` testInstance.findByType(type) ``` -Find the first descendant test instance with the provided `type`. +Find the only descendant test instance with the provided `type`. If there is not exactly one test instance with the provided `type`, it will throw an error. ### `testInstance.findByProps()` @@ -174,7 +174,7 @@ Find the first descendant test instance with the provided `type`. testInstance.findByProps(props) ``` -Find the first descendant test instance with the provided `props`. +Find the only descendant test instance with the provided `props`. If there is not exactly one test instance with the provided `props`, it will throw an error. ### `testInstance.findAll()` From b373eeccbd9827ec3f60c79eba1399189fd18215 Mon Sep 17 00:00:00 2001 From: Rodrigo Rosenfeld Rosas Date: Mon, 9 Oct 2017 21:08:05 -0300 Subject: [PATCH 14/43] Improves the documentation on Reconciliation --- content/docs/reconciliation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/docs/reconciliation.md b/content/docs/reconciliation.md index ce0bfb26..9bf5d304 100644 --- a/content/docs/reconciliation.md +++ b/content/docs/reconciliation.md @@ -142,7 +142,7 @@ As a last resort, you can pass item's index in the array as a key. This can work ## Tradeoffs -It is important to remember that the reconciliation algorithm is an implementation detail. React could rerender the whole app on every action; the end result would be the same. We are regularly refining the heuristics in order to make common use cases faster. +It is important to remember that the reconciliation algorithm is an implementation detail. React could rerender the whole app on every action; the end result would be the same. Just to be clear, rerender in this context means calling `render` for all components, it doesn't mean React will unmount and remount them. It will only apply the differences following the rules stated in the previous sections. We are regularly refining the heuristics in order to make common use cases faster. In the current implementation, you can express the fact that a subtree has been moved amongst its siblings, but you cannot tell that it has moved somewhere else. The algorithm will rerender that full subtree. From 037fdf82d02532d59e08ec40c85d7a813d91524a Mon Sep 17 00:00:00 2001 From: sw-yx Date: Mon, 9 Oct 2017 22:11:11 -0400 Subject: [PATCH 15/43] modified handling-events page --- content/docs/handling-events.md | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/content/docs/handling-events.md b/content/docs/handling-events.md index 38b985ee..5a64a395 100644 --- a/content/docs/handling-events.md +++ b/content/docs/handling-events.md @@ -145,11 +145,5 @@ The problem with this syntax is that a different callback is created each time t Inside a loop it is common to want to pass a param to an event handler. For example if `i` is the row id: ```js - -``` - -or alternatively (especially if you want to avoid triggering a re-render in a child component): - -```js - -``` + +``` \ No newline at end of file From 4b155a22ed9cd1e7c9d9688d249d21e4e0837b99 Mon Sep 17 00:00:00 2001 From: jxom Date: Tue, 10 Oct 2017 15:30:25 +1100 Subject: [PATCH 16/43] PR changes --- .../StickyResponsiveSidebar.js | 2 +- src/templates/components/MetaTitle/index.js | 14 +- src/templates/components/Sidebar/Section.js | 47 ++--- yarn.lock | 180 +++++++++++------- 4 files changed, 136 insertions(+), 107 deletions(-) diff --git a/src/components/StickyResponsiveSidebar/StickyResponsiveSidebar.js b/src/components/StickyResponsiveSidebar/StickyResponsiveSidebar.js index d2981de3..70547391 100644 --- a/src/components/StickyResponsiveSidebar/StickyResponsiveSidebar.js +++ b/src/components/StickyResponsiveSidebar/StickyResponsiveSidebar.js @@ -149,7 +149,7 @@ class StickyResponsiveSidebar extends Component { }} onClick={this._openNavMenu} role="button" - tabIndex="-1"> + tabIndex={0}>
( +const MetaTitle = ({children, title, cssProps = {}, onDark = false}) => (
+ }}> {children}
); diff --git a/src/templates/components/Sidebar/Section.js b/src/templates/components/Sidebar/Section.js index 517a89dd..ff7a4596 100644 --- a/src/templates/components/Sidebar/Section.js +++ b/src/templates/components/Sidebar/Section.js @@ -26,32 +26,35 @@ const Section = ({ section, }) => (
- + - {section.title} - + {section.title} + - + [media.lessThan('small')]: { + display: 'none', + }, + }} + /> + +
    =6.0.0 <=6.1.1": +"emoji-regex@>=6.0.0 <=6.1.1", emoji-regex@^6.1.0: version "6.1.1" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-6.1.1.tgz#c6cd0ec1b0642e2a3c67a1137efc5e796da4f88e" @@ -3076,6 +3100,10 @@ escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" +eslint-config-fbjs@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/eslint-config-fbjs/-/eslint-config-fbjs-2.0.0.tgz#9f6ed690f500c2d750bf651e0cf1c65cf10b1c14" + eslint-config-prettier@^2.6.0: version "2.6.0" resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-2.6.0.tgz#f21db0ebb438ad678fb98946097c4bb198befccc" @@ -3086,12 +3114,28 @@ eslint-config-react@^1.1.7: version "1.1.7" resolved "https://registry.yarnpkg.com/eslint-config-react/-/eslint-config-react-1.1.7.tgz#a0918d0fc47d0e9bd161a47308021da85d2585b3" -eslint-plugin-flowtype@^2.37.0: - version "2.37.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.37.0.tgz#2b09694deea6efdd8354eccd328db134b2d8b6d5" +eslint-plugin-babel@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/eslint-plugin-babel/-/eslint-plugin-babel-4.1.2.tgz#79202a0e35757dd92780919b2336f1fa2fe53c1e" + +eslint-plugin-flowtype@^2.39.1: + version "2.39.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.39.1.tgz#b5624622a0388bcd969f4351131232dcb9649cd5" dependencies: lodash "^4.15.0" +eslint-plugin-jsx-a11y@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.0.2.tgz#659277a758b036c305a7e4a13057c301cd3be73f" + dependencies: + aria-query "^0.7.0" + array-includes "^3.0.3" + ast-types-flow "0.0.7" + axobject-query "^0.1.0" + damerau-levenshtein "^1.0.0" + emoji-regex "^6.1.0" + jsx-ast-utils "^1.4.0" + eslint-plugin-prettier@^2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-2.3.1.tgz#e7a746c67e716f335274b88295a9ead9f544e44d" @@ -3108,6 +3152,12 @@ eslint-plugin-react@^7.4.0: jsx-ast-utils "^2.0.0" prop-types "^15.5.10" +eslint-plugin-relay@^0.0.19: + version "0.0.19" + resolved "https://registry.yarnpkg.com/eslint-plugin-relay/-/eslint-plugin-relay-0.0.19.tgz#68767f79f19bf81e2aa6a7ccf82fe30d65015efe" + dependencies: + graphql "^0.11.3" + eslint-scope@^3.7.1: version "3.7.1" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8" @@ -3175,10 +3225,6 @@ esprima@^2.6.0: version "2.7.3" resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" -esprima@^3.1.1: - version "3.1.3" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" - esprima@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804" @@ -3461,9 +3507,9 @@ fb-watchman@^2.0.0: dependencies: bser "^2.0.0" -fbjs@^0.8.1, fbjs@^0.8.16: - version "0.8.16" - resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.16.tgz#5e67432f550dc41b572bf55847b8aca64e5337db" +fbjs@^0.8.1, fbjs@^0.8.12, fbjs@^0.8.9: + version "0.8.14" + resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.14.tgz#d1dbe2be254c35a91e09f31f9cd50a40b2a0ed1c" dependencies: core-js "^1.0.0" isomorphic-fetch "^2.1.1" @@ -3473,9 +3519,9 @@ fbjs@^0.8.1, fbjs@^0.8.16: setimmediate "^1.0.5" ua-parser-js "^0.7.9" -fbjs@^0.8.12, fbjs@^0.8.9: - version "0.8.14" - resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.14.tgz#d1dbe2be254c35a91e09f31f9cd50a40b2a0ed1c" +fbjs@^0.8.16: + version "0.8.16" + resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.16.tgz#5e67432f550dc41b572bf55847b8aca64e5337db" dependencies: core-js "^1.0.0" isomorphic-fetch "^2.1.1" @@ -4392,12 +4438,18 @@ graphql-skip-limit@^1.0.5: dependencies: babel-runtime "^6.26.0" -graphql@0.10.5, graphql@^0.10.3, graphql@^0.10.5: +graphql@^0.10.3, graphql@^0.10.5: version "0.10.5" resolved "https://registry.yarnpkg.com/graphql/-/graphql-0.10.5.tgz#c9be17ca2bdfdbd134077ffd9bbaa48b8becd298" dependencies: iterall "^1.1.0" +graphql@^0.11.3: + version "0.11.7" + resolved "https://registry.yarnpkg.com/graphql/-/graphql-0.11.7.tgz#e5abaa9cb7b7cccb84e9f0836bf4370d268750c6" + dependencies: + iterall "1.1.3" + gray-matter@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/gray-matter/-/gray-matter-2.1.1.tgz#3042d9adec2a1ded6a7707a9ed2380f8a17a430e" @@ -4869,26 +4921,7 @@ inline-style-prefixer@^3.0.6: bowser "^1.6.0" css-in-js-utils "^1.0.3" -inquirer@^3.0.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-3.1.1.tgz#87621c4fba4072f48a8dd71c9f9df6f100b2d534" - dependencies: - ansi-escapes "^2.0.0" - chalk "^1.0.0" - cli-cursor "^2.1.0" - cli-width "^2.0.0" - external-editor "^2.0.4" - figures "^2.0.0" - lodash "^4.3.0" - mute-stream "0.0.7" - run-async "^2.2.0" - rx-lite "^4.0.8" - rx-lite-aggregates "^4.0.8" - string-width "^2.0.0" - strip-ansi "^3.0.0" - through "^2.3.6" - -inquirer@^3.0.6: +inquirer@^3.0.1, inquirer@^3.0.6: version "3.3.0" resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-3.3.0.tgz#9dd2f2ad765dcab1ff0443b491442a20ba227dc9" dependencies: @@ -5341,6 +5374,10 @@ items@2.x.x: version "2.1.1" resolved "https://registry.yarnpkg.com/items/-/items-2.1.1.tgz#8bd16d9c83b19529de5aea321acaada78364a198" +iterall@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/iterall/-/iterall-1.1.3.tgz#1cbbff96204056dde6656e2ed2e2226d0e6d72c9" + iterall@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/iterall/-/iterall-1.1.1.tgz#f7f0af11e9a04ec6426260f5019d9fcca4d50214" @@ -5386,14 +5423,7 @@ js-tokens@^3.0.0, js-tokens@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" -js-yaml@^3.4.6, js-yaml@^3.5.2, js-yaml@^3.8.1: - version "3.8.4" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.8.4.tgz#520b4564f86573ba96662af85a8cafa7b4b5a6f6" - dependencies: - argparse "^1.0.7" - esprima "^3.1.1" - -js-yaml@^3.9.1: +js-yaml@^3.4.6, js-yaml@^3.5.2, js-yaml@^3.8.1, js-yaml@^3.9.1: version "3.10.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.10.0.tgz#2e78441646bd4682e963f22b6e92823c309c62dc" dependencies: @@ -5547,6 +5577,10 @@ jsprim@^1.2.2: json-schema "0.2.3" verror "1.3.6" +jsx-ast-utils@^1.4.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-1.4.1.tgz#3867213e8dd79bf1e8f2300c0cfc1efb182c0df1" + jsx-ast-utils@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-2.0.1.tgz#e801b1b39985e20fffc87b40e3748080e2dcac7f" @@ -6189,13 +6223,13 @@ mime-db@~1.25.0: version "1.25.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.25.0.tgz#c18dbd7c73a5dbf6f44a024dc0d165a1e7b1c392" -mime-types@2.1.13: +mime-types@2.1.13, mime-types@~2.1.11: version "2.1.13" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.13.tgz#e07aaa9c6c6b9a7ca3012c69003ad25a39e92a88" dependencies: mime-db "~1.25.0" -mime-types@^2.1.12, mime-types@~2.1.11, mime-types@~2.1.15, mime-types@~2.1.7: +mime-types@^2.1.12, mime-types@~2.1.15, mime-types@~2.1.7: version "2.1.15" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.15.tgz#a4ebf5064094569237b8cf70046776d09fc92aed" dependencies: @@ -7513,11 +7547,7 @@ preserve@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" -prettier@^1.3.1: - version "1.5.2" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.5.2.tgz#7ea0751da27b93bfb6cecfcec509994f52d83bb3" - -prettier@^1.7.4: +prettier@^1.3.1, prettier@^1.7.4: version "1.7.4" resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.7.4.tgz#5e8624ae9363c80f95ec644584ecdf55d74f93fa" @@ -7580,14 +7610,14 @@ promise@^7.1.1: dependencies: asap "~2.0.3" -prop-types@^15.5.10, prop-types@^15.5.8: +prop-types@^15.5.10, prop-types@^15.5.4, prop-types@^15.5.8: version "15.5.10" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.5.10.tgz#2797dfc3126182e3a95e3dfbb2e893ddd7456154" dependencies: fbjs "^0.8.9" loose-envify "^1.3.1" -prop-types@^15.5.4, prop-types@^15.6.0: +prop-types@^15.6.0: version "15.6.0" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.0.tgz#ceaf083022fc46b4a35f69e13ef75aed0d639856" dependencies: @@ -7725,7 +7755,16 @@ react-deep-force-update@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/react-deep-force-update/-/react-deep-force-update-2.0.1.tgz#4f7f6c12c3e7de42f345992a3c518236fa1ecad3" -react-dom@16.0.0, react-dom@^15.6.0, react-dom@^16.0.0: +react-dom@^15.6.0: + version "15.6.2" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-15.6.2.tgz#41cfadf693b757faf2708443a1d1fd5a02bef730" + dependencies: + fbjs "^0.8.9" + loose-envify "^1.1.0" + object-assign "^4.1.0" + prop-types "^15.5.10" + +react-dom@^16.0.0: version "16.0.0" resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.0.0.tgz#9cc3079c3dcd70d4c6e01b84aab2a7e34c303f58" dependencies: @@ -7788,7 +7827,17 @@ react-side-effect@^1.1.0: exenv "^1.2.1" shallowequal "^1.0.1" -react@16.0.0, react@^15.6.0, react@^16.0.0: +react@^15.6.0: + version "15.6.2" + resolved "https://registry.yarnpkg.com/react/-/react-15.6.2.tgz#dba0434ab439cfe82f108f0f511663908179aa72" + dependencies: + create-react-class "^15.6.0" + fbjs "^0.8.9" + loose-envify "^1.1.0" + object-assign "^4.1.0" + prop-types "^15.5.10" + +react@^16.0.0: version "16.0.0" resolved "https://registry.yarnpkg.com/react/-/react-16.0.0.tgz#ce7df8f1941b036f02b2cca9dbd0cb1f0e855e2d" dependencies: @@ -8974,13 +9023,6 @@ string-width@^1.0.1, string-width@^1.0.2: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" -string-width@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.0.tgz#030664561fc146c9423ec7d978fe2457437fe6d0" - dependencies: - is-fullwidth-code-point "^2.0.0" - strip-ansi "^4.0.0" - string-width@^2.1.0, string-width@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" @@ -9363,18 +9405,12 @@ topo@2.x.x: dependencies: hoek "4.x.x" -tough-cookie@>=2.3.3: +tough-cookie@>=2.3.3, tough-cookie@~2.3.0: version "2.3.3" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.3.tgz#0b618a5565b6dea90bf3425d04d55edc475a7561" dependencies: punycode "^1.4.1" -tough-cookie@~2.3.0: - version "2.3.2" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.2.tgz#f081f76e4c85720e6c37a5faced737150d84072a" - dependencies: - punycode "^1.4.1" - tracer@^0.8.9: version "0.8.11" resolved "https://registry.yarnpkg.com/tracer/-/tracer-0.8.11.tgz#5941c67404410d86665b75bba68bb1c9d2c3cacd" From bad3d8853ca5b826e25de387a92956c2593d8ed2 Mon Sep 17 00:00:00 2001 From: ishank Date: Tue, 10 Oct 2017 13:35:27 +0530 Subject: [PATCH 17/43] Recommmended PureComponent instead of shallowCompare --- content/docs/addons.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/docs/addons.md b/content/docs/addons.md index 374bedab..669499cc 100644 --- a/content/docs/addons.md +++ b/content/docs/addons.md @@ -22,7 +22,7 @@ The add-ons below are in the development (unminified) version of React only: The add-ons below are considered legacy and their use is discouraged. They will keep working in observable future, but there is no further development. - [`PureRenderMixin`](pure-render-mixin.html). Use [`React.PureComponent`](/docs/react-api.html#react.purecomponent) instead. -- [`shallowCompare`](shallow-compare.html), a helper function that performs a shallow comparison for props and state in a component to decide if a component should update. +- [`shallowCompare`](shallow-compare.html), a helper function that performs a shallow comparison for props and state in a component to decide if a component should update. Use [`React.PureComponent`](/docs/react-api.html#react.purecomponent) instead. - [`update`](update.html). Use [`kolodny/immutability-helper`](https://github.com/kolodny/immutability-helper) instead. - [`ReactDOMFactories`](dom-factories.html), pre-configured DOM factories to make React easier to use without JSX. From 16b5b8f51012b65ba5d559071587691b82f87350 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Tue, 10 Oct 2017 11:54:43 +0100 Subject: [PATCH 18/43] Tweak instructions --- content/docs/how-to-contribute.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/docs/how-to-contribute.md b/content/docs/how-to-contribute.md index ff97aec5..e514a948 100644 --- a/content/docs/how-to-contribute.md +++ b/content/docs/how-to-contribute.md @@ -95,7 +95,7 @@ In order to accept your pull request, we need you to submit a CLA. You only need ### Contribution Prerequisites -* You have `node` installed at v4.0.0+ and `npm` at v2.0.0+. +* You have `node` installed at v6.0.0+ and `npm` at v3.0.0+. * You have `gcc` installed or are comfortable installing a compiler if needed. Some of our `npm` dependencies may require a compilation step. On OS X, the Xcode Command Line Tools will cover this. On Ubuntu, `apt-get install build-essential` will install the required packages. Similar commands should work on other Linux distros. Windows will require some additional steps, see the [`node-gyp` installation instructions](https://github.com/nodejs/node-gyp#installation) for details. * You are familiar with `npm` and know whether or not you need to use `sudo` when installing packages globally. * You are familiar with `git`. @@ -118,7 +118,7 @@ First, run `npm run build`. This will produce pre-built bundles in `build` folde The easiest way to try your changes is to run `npm run build` and then open `fixtures/packaging/babel-standalone/dev.html`. This file already uses `react.js` from the `build` folder so it will pick up your changes. -If you want to try your changes in your existing React project, you may copy `build/umd/react.development.js`, `build/umd/react-dom.development.js`, or any other build products into your app and use them instead of the stable version. If your project uses React from npm, you may delete `react` and `react-dom` in its dependencies and use `npm link` to point them to your local `build` folder: +If you want to try your changes in your existing React project, you may copy `build/dist/react.development.js`, `build/dist/react-dom.development.js`, or any other build products into your app and use them instead of the stable version. If your project uses React from npm, you may delete `react` and `react-dom` in its dependencies and use `npm link` to point them to your local `build` folder: ```sh cd your_project From a2011135358dc9d88543ba67b647c9eb2adea169 Mon Sep 17 00:00:00 2001 From: Fredrick Mgbeoma Date: Tue, 10 Oct 2017 12:51:41 +0100 Subject: [PATCH 19/43] Added ellipsis to indicate incomplete code snippet (#115) * Added ellipsis to indicate incomplete code snippet Ellipsis indicate that the code snippet shown is part of a larger code sample. * Add missing indentation --- content/docs/lifting-state-up.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/content/docs/lifting-state-up.md b/content/docs/lifting-state-up.md index e7beb98e..43cb7db8 100644 --- a/content/docs/lifting-state-up.md +++ b/content/docs/lifting-state-up.md @@ -166,6 +166,7 @@ class TemperatureInput extends React.Component { render() { const temperature = this.state.temperature; + // ... ``` However, we want these two inputs to be in sync with each other. When we update the Celsius input, the Fahrenheit input should reflect the converted temperature, and vice versa. @@ -182,6 +183,7 @@ First, we will replace `this.state.temperature` with `this.props.temperature` in render() { // Before: const temperature = this.state.temperature; const temperature = this.props.temperature; + // ... ``` We know that [props are read-only](/docs/components-and-props.html#props-are-read-only). When the `temperature` was in the local state, the `TemperatureInput` could just call `this.setState()` to change it. However, now that the `temperature` is coming from the parent as a prop, the `TemperatureInput` has no control over it. @@ -194,6 +196,7 @@ Now, when the `TemperatureInput` wants to update its temperature, it calls `this handleChange(e) { // Before: this.setState({temperature: e.target.value}); this.props.onTemperatureChange(e.target.value); + // ... ``` >Note: From 2ef21dfd4cdf035e8601b1688a71bfaa20d6b7a4 Mon Sep 17 00:00:00 2001 From: Max Humme Date: Mon, 9 Oct 2017 20:43:41 +0200 Subject: [PATCH 20/43] Clarify idea for improvement 1. When I was working through this, I found it not completely clear what was meant by 'instead of "6"'. I assumed the document refers to the move numbers in the move list, so that's what this change clarifies. --- content/tutorial/tutorial.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/tutorial/tutorial.md b/content/tutorial/tutorial.md index c38344fd..16be5c8b 100644 --- a/content/tutorial/tutorial.md +++ b/content/tutorial/tutorial.md @@ -1090,7 +1090,7 @@ Check out the final result here: [Final Result](https://codepen.io/gaearon/pen/g If you have extra time or want to practice your new skills, here are some ideas for improvements you could make, listed in order of increasing difficulty: -1. Display the move locations in the format "(1, 3)" instead of "6". +1. Display the move locations in the format "(1, 3)" in the move list. 2. Bold the currently selected item in the move list. 3. Rewrite Board to use two loops to make the squares instead of hardcoding them. 4. Add a toggle button that lets you sort the moves in either ascending or descending order. From bcd06d058e1b1f3660cefab7bfc971fcad7e52c3 Mon Sep 17 00:00:00 2001 From: Sergey Lysenko Date: Tue, 10 Oct 2017 15:37:05 +0200 Subject: [PATCH 21/43] Fix some brand names in the docs --- README.md | 2 +- content/docs/accessibility.md | 2 +- content/warnings/refs-must-have-owner.md | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index aa23cacf..b5c09a5c 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ This repo contains the source code and documentation powering [reactjs.org](http ### Installation 1. `cd reactjs.org` to go into the project root -1. `yarn` to install the website's NPM dependencies +1. `yarn` to install the website's npm dependencies ### Running locally diff --git a/content/docs/accessibility.md b/content/docs/accessibility.md index 77cc52df..84578951 100644 --- a/content/docs/accessibility.md +++ b/content/docs/accessibility.md @@ -263,7 +263,7 @@ VoiceOver is an integrated screen reader on Apple devices. Refer to the following guides on how activate and use VoiceOver: - [WebAIM - Using VoiceOver to Evaluate Web Accessibility](http://webaim.org/articles/voiceover/) -- [Deque - VoiceOver for OSX Keyboard Shortcuts](https://dequeuniversity.com/screenreaders/voiceover-keyboard-shortcuts) +- [Deque - VoiceOver for OS X Keyboard Shortcuts](https://dequeuniversity.com/screenreaders/voiceover-keyboard-shortcuts) - [Deque - VoiceOver for iOS Shortcuts](https://dequeuniversity.com/screenreaders/voiceover-ios-shortcuts) #### JAWS in Internet Explorer diff --git a/content/warnings/refs-must-have-owner.md b/content/warnings/refs-must-have-owner.md index 2fca7ff9..2a03a57b 100644 --- a/content/warnings/refs-must-have-owner.md +++ b/content/warnings/refs-must-have-owner.md @@ -19,7 +19,7 @@ You are probably here because you got one of the following error messages: This usually means one of two things: - You are trying to add a `ref` to an element that is being created outside of a component's render() function. -- You have multiple (conflicting) copies of React loaded (eg. due to a misconfigured NPM dependency) +- You have multiple (conflicting) copies of React loaded (eg. due to a misconfigured npm dependency) ## Invalid Refs @@ -28,6 +28,6 @@ Only a ReactOwner can have refs. This usually means that you're trying to add a ## Multiple copies of React -Bower does a good job of deduplicating dependencies, but NPM does not. If you aren't doing anything (fancy) with refs, there is a good chance that the problem is not with your refs, but rather an issue with having multiple copies of React loaded into your project. Sometimes, when you pull in a third-party module via npm, you will get a duplicate copy of the dependency library, and this can create problems. +Bower does a good job of deduplicating dependencies, but npm does not. If you aren't doing anything (fancy) with refs, there is a good chance that the problem is not with your refs, but rather an issue with having multiple copies of React loaded into your project. Sometimes, when you pull in a third-party module via npm, you will get a duplicate copy of the dependency library, and this can create problems. If you are using npm... `npm ls` or `npm ls react` might help illuminate. From 348a727e8c02fb091d1cc780202026f4e4e535a0 Mon Sep 17 00:00:00 2001 From: Brian Vaughn Date: Tue, 10 Oct 2017 08:19:29 -0700 Subject: [PATCH 22/43] Added parens --- content/docs/reconciliation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/docs/reconciliation.md b/content/docs/reconciliation.md index 9bf5d304..7b36664a 100644 --- a/content/docs/reconciliation.md +++ b/content/docs/reconciliation.md @@ -142,7 +142,7 @@ As a last resort, you can pass item's index in the array as a key. This can work ## Tradeoffs -It is important to remember that the reconciliation algorithm is an implementation detail. React could rerender the whole app on every action; the end result would be the same. Just to be clear, rerender in this context means calling `render` for all components, it doesn't mean React will unmount and remount them. It will only apply the differences following the rules stated in the previous sections. We are regularly refining the heuristics in order to make common use cases faster. +It is important to remember that the reconciliation algorithm is an implementation detail. React could rerender the whole app on every action; the end result would be the same. (Just to be clear, rerender in this context means calling `render` for all components, it doesn't mean React will unmount and remount them. It will only apply the differences following the rules stated in the previous sections.) We are regularly refining the heuristics in order to make common use cases faster. In the current implementation, you can express the fact that a subtree has been moved amongst its siblings, but you cannot tell that it has moved somewhere else. The algorithm will rerender that full subtree. From 3dfc414701a155a11694b212423265cc85fa3f5b Mon Sep 17 00:00:00 2001 From: Brian Vaughn Date: Tue, 10 Oct 2017 08:32:29 -0700 Subject: [PATCH 23/43] Nit --- content/docs/handling-events.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/content/docs/handling-events.md b/content/docs/handling-events.md index 5a64a395..81da691c 100644 --- a/content/docs/handling-events.md +++ b/content/docs/handling-events.md @@ -145,5 +145,6 @@ The problem with this syntax is that a different callback is created each time t Inside a loop it is common to want to pass a param to an event handler. For example if `i` is the row id: ```js + -``` \ No newline at end of file +``` From 7f8d084a2c35c519f010634c757c0bd1b2fb1d51 Mon Sep 17 00:00:00 2001 From: Brian Vaughn Date: Tue, 10 Oct 2017 08:33:00 -0700 Subject: [PATCH 24/43] Wordsmithing --- content/docs/handling-events.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/docs/handling-events.md b/content/docs/handling-events.md index 81da691c..4690d8c7 100644 --- a/content/docs/handling-events.md +++ b/content/docs/handling-events.md @@ -142,7 +142,7 @@ The problem with this syntax is that a different callback is created each time t ## Passing arguments to event handlers -Inside a loop it is common to want to pass a param to an event handler. For example if `i` is the row id: +Inside a loop it is common to want to pass a param to an event handler. For example, if `i` is the row id, either of the following would work: ```js From ad8cb6ea709aae9a7f551f79c185ef12f9342a02 Mon Sep 17 00:00:00 2001 From: Rodrigo Rosenfeld Rosas Date: Tue, 10 Oct 2017 12:36:29 -0300 Subject: [PATCH 25/43] Improve writing style in Reconciliation Tradeoffs (#119) I've improved my previous changes to what re-render means by following Dan Abramov's suggestion on the writing style to remove the parenthesis from that paragraph. See issue #108 for more context. --- content/docs/reconciliation.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/docs/reconciliation.md b/content/docs/reconciliation.md index 7b36664a..6a23282c 100644 --- a/content/docs/reconciliation.md +++ b/content/docs/reconciliation.md @@ -142,9 +142,9 @@ As a last resort, you can pass item's index in the array as a key. This can work ## Tradeoffs -It is important to remember that the reconciliation algorithm is an implementation detail. React could rerender the whole app on every action; the end result would be the same. (Just to be clear, rerender in this context means calling `render` for all components, it doesn't mean React will unmount and remount them. It will only apply the differences following the rules stated in the previous sections.) We are regularly refining the heuristics in order to make common use cases faster. +It is important to remember that the reconciliation algorithm is an implementation detail. React could rerender the whole app on every action; the end result would be the same. Just to be clear, rerender in this context means calling `render` for all components, it doesn't mean React will unmount and remount them. It will only apply the differences following the rules stated in the previous sections. -In the current implementation, you can express the fact that a subtree has been moved amongst its siblings, but you cannot tell that it has moved somewhere else. The algorithm will rerender that full subtree. +We are regularly refining the heuristics in order to make common use cases faster. In the current implementation, you can express the fact that a subtree has been moved amongst its siblings, but you cannot tell that it has moved somewhere else. The algorithm will rerender that full subtree. Because React relies on heuristics, if the assumptions behind them are not met, performance will suffer. From db1262d06f7ec5081886c8257afe0e6c239dd16c Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Tue, 10 Oct 2017 16:42:48 +0100 Subject: [PATCH 26/43] Tweak the event doc --- content/docs/handling-events.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/content/docs/handling-events.md b/content/docs/handling-events.md index 4690d8c7..4077e45d 100644 --- a/content/docs/handling-events.md +++ b/content/docs/handling-events.md @@ -140,11 +140,15 @@ class LoggingButton extends React.Component { The problem with this syntax is that a different callback is created each time the `LoggingButton` renders. In most cases, this is fine. However, if this callback is passed as a prop to lower components, those components might do an extra re-rendering. We generally recommend binding in the constructor or using the class fields syntax, to avoid this sort of performance problem. -## Passing arguments to event handlers +## Passing Arguments to Event Handlers -Inside a loop it is common to want to pass a param to an event handler. For example, if `i` is the row id, either of the following would work: +Inside a loop it is common to want to pass an extra parameter to an event handler. For example, if `id` is the row ID, either of the following would work: ```js - - + + ``` + +The above two lines are equivalent, and use [arrow functions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions) and [`Function.prototype.bind`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_objects/Function/bind) respectively. + +In both cases, the `e` argument representing the React event will be passed as a second argument after the ID. With an arrow function, we have to pass it explicitly, but with `bind` any further arguments are automatically forwarded. From 18000f1b3740f0569a0b769ad422d4ebebfcbd5b Mon Sep 17 00:00:00 2001 From: Brian Vaughn Date: Tue, 10 Oct 2017 09:34:28 -0700 Subject: [PATCH 27/43] Wording nit: s/the only/a single/ --- content/docs/reference-test-renderer.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/docs/reference-test-renderer.md b/content/docs/reference-test-renderer.md index 9e463400..4c6bcfc4 100644 --- a/content/docs/reference-test-renderer.md +++ b/content/docs/reference-test-renderer.md @@ -158,7 +158,7 @@ Returns the root "test instance" object that is useful for making assertions abo testInstance.find(test) ``` -Find the only descendant test instance for which `test(testInstance)` returns `true`. If `test(testInstance)` does not return `true` for exactly one test instance, it will throw an error. +Find a single descendant test instance for which `test(testInstance)` returns `true`. If `test(testInstance)` does not return `true` for exactly one test instance, it will throw an error. ### `testInstance.findByType()` @@ -166,7 +166,7 @@ Find the only descendant test instance for which `test(testInstance)` returns `t testInstance.findByType(type) ``` -Find the only descendant test instance with the provided `type`. If there is not exactly one test instance with the provided `type`, it will throw an error. +Find a single descendant test instance with the provided `type`. If there is not exactly one test instance with the provided `type`, it will throw an error. ### `testInstance.findByProps()` @@ -174,7 +174,7 @@ Find the only descendant test instance with the provided `type`. If there is not testInstance.findByProps(props) ``` -Find the only descendant test instance with the provided `props`. If there is not exactly one test instance with the provided `props`, it will throw an error. +Find a single descendant test instance with the provided `props`. If there is not exactly one test instance with the provided `props`, it will throw an error. ### `testInstance.findAll()` From a3445b3ce66ac5cd7eb6ce9303d6eb0298875041 Mon Sep 17 00:00:00 2001 From: ishank Date: Tue, 10 Oct 2017 22:28:51 +0530 Subject: [PATCH 28/43] changed wording --- content/docs/addons.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/docs/addons.md b/content/docs/addons.md index 669499cc..051062d7 100644 --- a/content/docs/addons.md +++ b/content/docs/addons.md @@ -22,7 +22,7 @@ The add-ons below are in the development (unminified) version of React only: The add-ons below are considered legacy and their use is discouraged. They will keep working in observable future, but there is no further development. - [`PureRenderMixin`](pure-render-mixin.html). Use [`React.PureComponent`](/docs/react-api.html#react.purecomponent) instead. -- [`shallowCompare`](shallow-compare.html), a helper function that performs a shallow comparison for props and state in a component to decide if a component should update. Use [`React.PureComponent`](/docs/react-api.html#react.purecomponent) instead. +- [`shallowCompare`](shallow-compare.html), a helper function that performs a shallow comparison for props and state in a component to decide if a component should update. We recommend using [`React.PureComponent`](/docs/react-api.html#react.purecomponent) instead. - [`update`](update.html). Use [`kolodny/immutability-helper`](https://github.com/kolodny/immutability-helper) instead. - [`ReactDOMFactories`](dom-factories.html), pre-configured DOM factories to make React easier to use without JSX. From 702fddd0f8bf102d1cf4ae41bf1af12398260d64 Mon Sep 17 00:00:00 2001 From: ishank Date: Tue, 10 Oct 2017 23:03:04 +0530 Subject: [PATCH 29/43] after merging correctly --- content/docs/addons.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/content/docs/addons.md b/content/docs/addons.md index 54817251..fdbce295 100644 --- a/content/docs/addons.md +++ b/content/docs/addons.md @@ -21,13 +21,8 @@ The add-ons below are in the development (unminified) version of React only: The add-ons below are considered legacy and their use is discouraged. They will keep working in observable future, but there is no further development. -<<<<<<< HEAD - [`PureRenderMixin`](pure-render-mixin.html). Use [`React.PureComponent`](/docs/react-api.html#reactpurecomponent) instead. - [`shallowCompare`](shallow-compare.html), a helper function that performs a shallow comparison for props and state in a component to decide if a component should update. We recommend using [`React.PureComponent`](/docs/react-api.html#reactpurecomponent) instead. -======= -- [`PureRenderMixin`](pure-render-mixin.html). Use [`React.PureComponent`](/docs/react-api.html#reactpurecomponent) instead. -- [`shallowCompare`](shallow-compare.html), a helper function that performs a shallow comparison for props and state in a component to decide if a component should update. ->>>>>>> a66e63b57527a3310573f49064b13dc64d6a0849 - [`update`](update.html). Use [`kolodny/immutability-helper`](https://github.com/kolodny/immutability-helper) instead. - [`ReactDOMFactories`](dom-factories.html), pre-configured DOM factories to make React easier to use without JSX. From be0374c6dd0021f13ea9327f78aac419560b8c96 Mon Sep 17 00:00:00 2001 From: Brian Vaughn Date: Tue, 10 Oct 2017 10:35:08 -0700 Subject: [PATCH 30/43] Removed LICENSE file for source code --- LICENSE.md | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 LICENSE.md diff --git a/LICENSE.md b/LICENSE.md deleted file mode 100644 index 5930f2b8..00000000 --- a/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2013-present, Facebook, Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file From 7a9f04cad8476ea0051c8b4a6861da00318b9a2a Mon Sep 17 00:00:00 2001 From: Brian Vaughn Date: Tue, 10 Oct 2017 10:36:40 -0700 Subject: [PATCH 31/43] Removed MIT section from website source file headers --- gatsby-config.js | 3 --- gatsby-node.js | 3 --- src/components/CodeEditor/CodeEditor.js | 3 --- src/components/CodeEditor/index.js | 3 --- src/components/Container/Container.js | 3 --- src/components/Container/index.js | 3 --- src/components/ErrorDecoder/ErrorDecoder.js | 3 --- src/components/ErrorDecoder/index.js | 3 --- src/components/Flex/Flex.js | 3 --- src/components/Flex/index.js | 3 --- src/components/Header/Header.js | 3 --- src/components/Header/index.js | 3 --- src/components/LayoutFooter/ExternalFooterLink.js | 3 --- src/components/LayoutFooter/Footer.js | 3 --- src/components/LayoutFooter/FooterLink.js | 3 --- src/components/LayoutFooter/FooterNav.js | 3 --- src/components/LayoutFooter/index.js | 3 --- src/components/LayoutHeader/Header.js | 3 --- src/components/LayoutHeader/HeaderLink.js | 3 --- src/components/LayoutHeader/SearchSvg.js | 3 --- src/components/LayoutHeader/index.js | 3 --- src/components/MarkdownHeader/MarkdownHeader.js | 3 --- src/components/MarkdownHeader/index.js | 3 --- src/components/MarkdownPage/MarkdownPage.js | 3 --- src/components/MarkdownPage/index.js | 3 --- .../StickyResponsiveSidebar/StickyResponsiveSidebar.js | 3 --- src/components/StickyResponsiveSidebar/index.js | 3 --- src/components/TitleAndMetaTags/TitleAndMetaTags.js | 3 --- src/components/TitleAndMetaTags/index.js | 3 --- src/html.js | 3 --- src/layouts/index.js | 3 --- src/pages/404.js | 3 --- src/pages/acknowledgements.html.js | 3 --- src/pages/blog/all.html.js | 3 --- src/pages/docs/error-decoder.html.js | 3 --- src/pages/jsx-compiler.html.js | 3 --- src/prism-styles.js | 3 --- src/site-constants.js | 3 --- src/templates/blog.js | 3 --- src/templates/community.js | 3 --- src/templates/components/ButtonLink/ButtonLink.js | 3 --- src/templates/components/ButtonLink/index.js | 3 --- src/templates/components/ChevronSvg/index.js | 3 --- src/templates/components/ExternalLinkSvg/index.js | 3 --- src/templates/components/MetaTitle/index.js | 3 --- src/templates/components/NavigationFooter/NavigationFooter.js | 3 --- src/templates/components/NavigationFooter/index.js | 3 --- src/templates/components/Sidebar/Section.js | 3 --- src/templates/components/Sidebar/Sidebar.js | 3 --- src/templates/components/Sidebar/index.js | 3 --- src/templates/docs.js | 3 --- src/templates/home.js | 3 --- src/templates/tutorial.js | 3 --- src/theme.js | 3 --- src/types.js | 3 --- src/utils/createLink.js | 3 --- src/utils/createOgUrl.js | 3 --- src/utils/findSectionForPath.js | 3 --- src/utils/isItemActive.js | 3 --- src/utils/mountCodeExample.js | 3 --- src/utils/sectionList.js | 3 --- src/utils/slugify.js | 3 --- src/utils/toCommaSeparatedList.js | 3 --- 63 files changed, 189 deletions(-) diff --git a/gatsby-config.js b/gatsby-config.js index b1469a55..029197a3 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/gatsby-node.js b/gatsby-node.js index 56f83aed..0fc10c4f 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/components/CodeEditor/CodeEditor.js b/src/components/CodeEditor/CodeEditor.js index 4733a854..c8c2d785 100644 --- a/src/components/CodeEditor/CodeEditor.js +++ b/src/components/CodeEditor/CodeEditor.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/components/CodeEditor/index.js b/src/components/CodeEditor/index.js index 4bc2ed71..74799777 100644 --- a/src/components/CodeEditor/index.js +++ b/src/components/CodeEditor/index.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/components/Container/Container.js b/src/components/Container/Container.js index 266fa066..7a458faf 100644 --- a/src/components/Container/Container.js +++ b/src/components/Container/Container.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core * @flow */ diff --git a/src/components/Container/index.js b/src/components/Container/index.js index d146cf6b..6a609558 100644 --- a/src/components/Container/index.js +++ b/src/components/Container/index.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/components/ErrorDecoder/ErrorDecoder.js b/src/components/ErrorDecoder/ErrorDecoder.js index da1f03c1..3e638d61 100644 --- a/src/components/ErrorDecoder/ErrorDecoder.js +++ b/src/components/ErrorDecoder/ErrorDecoder.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/components/ErrorDecoder/index.js b/src/components/ErrorDecoder/index.js index b034c178..68931622 100644 --- a/src/components/ErrorDecoder/index.js +++ b/src/components/ErrorDecoder/index.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/components/Flex/Flex.js b/src/components/Flex/Flex.js index 30d2d97e..6acc11e6 100644 --- a/src/components/Flex/Flex.js +++ b/src/components/Flex/Flex.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/components/Flex/index.js b/src/components/Flex/index.js index 5d9eaeab..1ec92e45 100644 --- a/src/components/Flex/index.js +++ b/src/components/Flex/index.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/components/Header/Header.js b/src/components/Header/Header.js index 0e69fff6..75ac9531 100644 --- a/src/components/Header/Header.js +++ b/src/components/Header/Header.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/components/Header/index.js b/src/components/Header/index.js index 787c1500..57114581 100644 --- a/src/components/Header/index.js +++ b/src/components/Header/index.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/components/LayoutFooter/ExternalFooterLink.js b/src/components/LayoutFooter/ExternalFooterLink.js index 876ab8a1..04632fda 100644 --- a/src/components/LayoutFooter/ExternalFooterLink.js +++ b/src/components/LayoutFooter/ExternalFooterLink.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/components/LayoutFooter/Footer.js b/src/components/LayoutFooter/Footer.js index 42d40d60..673534fe 100644 --- a/src/components/LayoutFooter/Footer.js +++ b/src/components/LayoutFooter/Footer.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/components/LayoutFooter/FooterLink.js b/src/components/LayoutFooter/FooterLink.js index ed676817..9969309e 100644 --- a/src/components/LayoutFooter/FooterLink.js +++ b/src/components/LayoutFooter/FooterLink.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/components/LayoutFooter/FooterNav.js b/src/components/LayoutFooter/FooterNav.js index 83049145..b3861b42 100644 --- a/src/components/LayoutFooter/FooterNav.js +++ b/src/components/LayoutFooter/FooterNav.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/components/LayoutFooter/index.js b/src/components/LayoutFooter/index.js index ebcf8ba8..42db340a 100644 --- a/src/components/LayoutFooter/index.js +++ b/src/components/LayoutFooter/index.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/components/LayoutHeader/Header.js b/src/components/LayoutHeader/Header.js index 467b956e..48037360 100644 --- a/src/components/LayoutHeader/Header.js +++ b/src/components/LayoutHeader/Header.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/components/LayoutHeader/HeaderLink.js b/src/components/LayoutHeader/HeaderLink.js index aa43c040..6ad92ca5 100644 --- a/src/components/LayoutHeader/HeaderLink.js +++ b/src/components/LayoutHeader/HeaderLink.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/components/LayoutHeader/SearchSvg.js b/src/components/LayoutHeader/SearchSvg.js index 2c388449..af88d5a6 100644 --- a/src/components/LayoutHeader/SearchSvg.js +++ b/src/components/LayoutHeader/SearchSvg.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/components/LayoutHeader/index.js b/src/components/LayoutHeader/index.js index 787c1500..57114581 100644 --- a/src/components/LayoutHeader/index.js +++ b/src/components/LayoutHeader/index.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/components/MarkdownHeader/MarkdownHeader.js b/src/components/MarkdownHeader/MarkdownHeader.js index d27e35bd..1b7a8da8 100644 --- a/src/components/MarkdownHeader/MarkdownHeader.js +++ b/src/components/MarkdownHeader/MarkdownHeader.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/components/MarkdownHeader/index.js b/src/components/MarkdownHeader/index.js index b0c79f19..c338ea60 100644 --- a/src/components/MarkdownHeader/index.js +++ b/src/components/MarkdownHeader/index.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/components/MarkdownPage/MarkdownPage.js b/src/components/MarkdownPage/MarkdownPage.js index 56f62b10..c71a90f4 100644 --- a/src/components/MarkdownPage/MarkdownPage.js +++ b/src/components/MarkdownPage/MarkdownPage.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/components/MarkdownPage/index.js b/src/components/MarkdownPage/index.js index 45b06413..589ca08e 100644 --- a/src/components/MarkdownPage/index.js +++ b/src/components/MarkdownPage/index.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/components/StickyResponsiveSidebar/StickyResponsiveSidebar.js b/src/components/StickyResponsiveSidebar/StickyResponsiveSidebar.js index 70547391..713a586c 100644 --- a/src/components/StickyResponsiveSidebar/StickyResponsiveSidebar.js +++ b/src/components/StickyResponsiveSidebar/StickyResponsiveSidebar.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/components/StickyResponsiveSidebar/index.js b/src/components/StickyResponsiveSidebar/index.js index 2d94022c..4e10be51 100644 --- a/src/components/StickyResponsiveSidebar/index.js +++ b/src/components/StickyResponsiveSidebar/index.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/components/TitleAndMetaTags/TitleAndMetaTags.js b/src/components/TitleAndMetaTags/TitleAndMetaTags.js index d4e6b81a..e764a1c8 100644 --- a/src/components/TitleAndMetaTags/TitleAndMetaTags.js +++ b/src/components/TitleAndMetaTags/TitleAndMetaTags.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/components/TitleAndMetaTags/index.js b/src/components/TitleAndMetaTags/index.js index 382c7b48..e8bea5ed 100644 --- a/src/components/TitleAndMetaTags/index.js +++ b/src/components/TitleAndMetaTags/index.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/html.js b/src/html.js index d6ba3835..1622122e 100644 --- a/src/html.js +++ b/src/html.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/layouts/index.js b/src/layouts/index.js index 65d034e0..b8e68576 100644 --- a/src/layouts/index.js +++ b/src/layouts/index.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/pages/404.js b/src/pages/404.js index 94546822..5ad0aebb 100644 --- a/src/pages/404.js +++ b/src/pages/404.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core * @flow */ diff --git a/src/pages/acknowledgements.html.js b/src/pages/acknowledgements.html.js index 0881deb7..962f6e2f 100644 --- a/src/pages/acknowledgements.html.js +++ b/src/pages/acknowledgements.html.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/pages/blog/all.html.js b/src/pages/blog/all.html.js index 44122b78..e0ccab69 100644 --- a/src/pages/blog/all.html.js +++ b/src/pages/blog/all.html.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core * @flow */ diff --git a/src/pages/docs/error-decoder.html.js b/src/pages/docs/error-decoder.html.js index 0c026f58..4022677a 100644 --- a/src/pages/docs/error-decoder.html.js +++ b/src/pages/docs/error-decoder.html.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/pages/jsx-compiler.html.js b/src/pages/jsx-compiler.html.js index c3681604..836c09d9 100644 --- a/src/pages/jsx-compiler.html.js +++ b/src/pages/jsx-compiler.html.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core * @flow */ diff --git a/src/prism-styles.js b/src/prism-styles.js index 34b9c90c..665ef8ab 100644 --- a/src/prism-styles.js +++ b/src/prism-styles.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core * @flow */ diff --git a/src/site-constants.js b/src/site-constants.js index 8d3b25df..f359559d 100644 --- a/src/site-constants.js +++ b/src/site-constants.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @providesModule site-constants * @flow */ diff --git a/src/templates/blog.js b/src/templates/blog.js index 33021c72..e520f718 100644 --- a/src/templates/blog.js +++ b/src/templates/blog.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/templates/community.js b/src/templates/community.js index eadb26bb..72f7a222 100644 --- a/src/templates/community.js +++ b/src/templates/community.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/templates/components/ButtonLink/ButtonLink.js b/src/templates/components/ButtonLink/ButtonLink.js index 6c63f64b..50eb0119 100644 --- a/src/templates/components/ButtonLink/ButtonLink.js +++ b/src/templates/components/ButtonLink/ButtonLink.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/templates/components/ButtonLink/index.js b/src/templates/components/ButtonLink/index.js index 1e4f5fdc..b17f0bf1 100644 --- a/src/templates/components/ButtonLink/index.js +++ b/src/templates/components/ButtonLink/index.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/templates/components/ChevronSvg/index.js b/src/templates/components/ChevronSvg/index.js index 7d1c689e..0ad82db3 100644 --- a/src/templates/components/ChevronSvg/index.js +++ b/src/templates/components/ChevronSvg/index.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/templates/components/ExternalLinkSvg/index.js b/src/templates/components/ExternalLinkSvg/index.js index fbbac287..904e7e68 100644 --- a/src/templates/components/ExternalLinkSvg/index.js +++ b/src/templates/components/ExternalLinkSvg/index.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/templates/components/MetaTitle/index.js b/src/templates/components/MetaTitle/index.js index 6d02296a..8bfd1425 100644 --- a/src/templates/components/MetaTitle/index.js +++ b/src/templates/components/MetaTitle/index.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/templates/components/NavigationFooter/NavigationFooter.js b/src/templates/components/NavigationFooter/NavigationFooter.js index b8f406b7..1c1a0f25 100644 --- a/src/templates/components/NavigationFooter/NavigationFooter.js +++ b/src/templates/components/NavigationFooter/NavigationFooter.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/templates/components/NavigationFooter/index.js b/src/templates/components/NavigationFooter/index.js index ea19e3c0..6b9cd4b7 100644 --- a/src/templates/components/NavigationFooter/index.js +++ b/src/templates/components/NavigationFooter/index.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/templates/components/Sidebar/Section.js b/src/templates/components/Sidebar/Section.js index ff7a4596..d3edf7cc 100644 --- a/src/templates/components/Sidebar/Section.js +++ b/src/templates/components/Sidebar/Section.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/templates/components/Sidebar/Sidebar.js b/src/templates/components/Sidebar/Sidebar.js index 2f423303..0ed8c5af 100644 --- a/src/templates/components/Sidebar/Sidebar.js +++ b/src/templates/components/Sidebar/Sidebar.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/templates/components/Sidebar/index.js b/src/templates/components/Sidebar/index.js index e1d7c800..642dd09f 100644 --- a/src/templates/components/Sidebar/index.js +++ b/src/templates/components/Sidebar/index.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/templates/docs.js b/src/templates/docs.js index 89be3c0f..b087d6d0 100644 --- a/src/templates/docs.js +++ b/src/templates/docs.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/templates/home.js b/src/templates/home.js index f0b23190..a2607617 100644 --- a/src/templates/home.js +++ b/src/templates/home.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/templates/tutorial.js b/src/templates/tutorial.js index 6919d029..33efed97 100644 --- a/src/templates/tutorial.js +++ b/src/templates/tutorial.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/theme.js b/src/theme.js index 50297bc9..e79f3030 100644 --- a/src/theme.js +++ b/src/theme.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @providesModule theme * @flow */ diff --git a/src/types.js b/src/types.js index 22a7a04e..782a5b6f 100644 --- a/src/types.js +++ b/src/types.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core * @flow */ diff --git a/src/utils/createLink.js b/src/utils/createLink.js index 9466462f..98ee4039 100644 --- a/src/utils/createLink.js +++ b/src/utils/createLink.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/utils/createOgUrl.js b/src/utils/createOgUrl.js index c8e467c3..e739aff0 100644 --- a/src/utils/createOgUrl.js +++ b/src/utils/createOgUrl.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/utils/findSectionForPath.js b/src/utils/findSectionForPath.js index 5e64bf47..4526a7b8 100644 --- a/src/utils/findSectionForPath.js +++ b/src/utils/findSectionForPath.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/utils/isItemActive.js b/src/utils/isItemActive.js index ad0dfe11..65ee686e 100644 --- a/src/utils/isItemActive.js +++ b/src/utils/isItemActive.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/utils/mountCodeExample.js b/src/utils/mountCodeExample.js index 71914409..a7ebece8 100644 --- a/src/utils/mountCodeExample.js +++ b/src/utils/mountCodeExample.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/utils/sectionList.js b/src/utils/sectionList.js index 49106215..b7cb8ae4 100644 --- a/src/utils/sectionList.js +++ b/src/utils/sectionList.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/utils/slugify.js b/src/utils/slugify.js index f13ecc38..9b509ec8 100644 --- a/src/utils/slugify.js +++ b/src/utils/slugify.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/utils/toCommaSeparatedList.js b/src/utils/toCommaSeparatedList.js index 2f17e160..96c6d9f7 100644 --- a/src/utils/toCommaSeparatedList.js +++ b/src/utils/toCommaSeparatedList.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ From b6e2f24421e2ef99da3a017081c50b69d8c02455 Mon Sep 17 00:00:00 2001 From: Anna Do Date: Tue, 10 Oct 2017 13:42:07 -0400 Subject: [PATCH 32/43] Added recommendation to use shallow rendering or jest.mock() --- content/docs/addons-test-utils.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/docs/addons-test-utils.md b/content/docs/addons-test-utils.md index 7552a1d9..cabf7bc3 100644 --- a/content/docs/addons-test-utils.md +++ b/content/docs/addons-test-utils.md @@ -114,7 +114,7 @@ Pass a mocked component module to this method to augment it with useful methods > Note: > -> `mockComponent()` is a legacy method that is no longer needed. A similar pattern can be implemented directly. +> `mockComponent()` is a legacy API. We recommend using [shallow rendering](/docs/test-utils.html#shallow-rendering) or [jest.mock()](https://facebook.github.io/jest/docs/en/tutorial-react-native.html#mock-native-modules-using-jestmock) instead. * * * From 0daa24f5691d058b2aeb10b918b5ae8de7643d08 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Tue, 10 Oct 2017 18:57:21 +0100 Subject: [PATCH 33/43] Backticks --- content/docs/addons-test-utils.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/docs/addons-test-utils.md b/content/docs/addons-test-utils.md index cabf7bc3..68bb48dc 100644 --- a/content/docs/addons-test-utils.md +++ b/content/docs/addons-test-utils.md @@ -114,7 +114,7 @@ Pass a mocked component module to this method to augment it with useful methods > Note: > -> `mockComponent()` is a legacy API. We recommend using [shallow rendering](/docs/test-utils.html#shallow-rendering) or [jest.mock()](https://facebook.github.io/jest/docs/en/tutorial-react-native.html#mock-native-modules-using-jestmock) instead. +> `mockComponent()` is a legacy API. We recommend using [shallow rendering](/docs/test-utils.html#shallow-rendering) or [`jest.mock()`](https://facebook.github.io/jest/docs/en/tutorial-react-native.html#mock-native-modules-using-jestmock) instead. * * * From ea6d90ef327018d41b1f0fb712a0adb883312030 Mon Sep 17 00:00:00 2001 From: renatoselenica Date: Tue, 10 Oct 2017 16:39:39 +0200 Subject: [PATCH 34/43] Changed the documentation for React.Children.only to make its implementation simpler to understand. Fixes #87 --- content/docs/reference-react.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/content/docs/reference-react.md b/content/docs/reference-react.md index f12dbdde..95a0ab49 100644 --- a/content/docs/reference-react.md +++ b/content/docs/reference-react.md @@ -176,7 +176,11 @@ Returns the total number of components in `children`, equal to the number of tim React.Children.only(children) ``` -Returns the only child in `children`. Throws otherwise. +Verifies that `children` has only one child (a React element) and returns it. Otherwise this method throws. + +> Note: +> +>`React.Children.only()` does not accept the return value of [`React.Children.map()`](#reactchildrenmap) because it is an array rather than a React element. #### `React.Children.toArray` From 3a238c8d09e8727c04f5ec2c9b119de50cc365f1 Mon Sep 17 00:00:00 2001 From: Florian Kissling Date: Tue, 10 Oct 2017 21:49:41 +0200 Subject: [PATCH 35/43] Fix typo Restores the sidebar transition when switching from and to small screen/"sticky" sidebar. --- .../StickyResponsiveSidebar/StickyResponsiveSidebar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/StickyResponsiveSidebar/StickyResponsiveSidebar.js b/src/components/StickyResponsiveSidebar/StickyResponsiveSidebar.js index 713a586c..13b2ec6c 100644 --- a/src/components/StickyResponsiveSidebar/StickyResponsiveSidebar.js +++ b/src/components/StickyResponsiveSidebar/StickyResponsiveSidebar.js @@ -123,7 +123,7 @@ class StickyResponsiveSidebar extends Component { }, [media.greaterThan('small')]: { - tranform: 'none !important', + transform: 'none !important', }, }}> From 6c9ca9beb681b6db56bad69153373c6e7c27f49b Mon Sep 17 00:00:00 2001 From: Matt Zabriskie Date: Tue, 10 Oct 2017 15:07:51 -0600 Subject: [PATCH 36/43] Fixing typo --- content/blog/2017-09-26-react-v16.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/blog/2017-09-26-react-v16.0.md b/content/blog/2017-09-26-react-v16.0.md index 9636e8f3..a2416036 100644 --- a/content/blog/2017-09-26-react-v16.0.md +++ b/content/blog/2017-09-26-react-v16.0.md @@ -151,7 +151,7 @@ Refer to the previous announcement for [suggestions on how to migrate](/blog/201 React 16 includes a number of small breaking changes. These only affect uncommon use cases and we don't expect them to break most apps. * React 15 had limited, undocumented support for error boundaries using `unstable_handleError`. This method has been renamed to `componentDidCatch`. You can use a codemod to [automatically migrate to the new API](https://github.com/reactjs/react-codemod#error-boundaries). -* `ReactDOM.render` and `ReactDOM.unstable_renderIntoContainer` now return null if called from inside a lifecycle method. To work around this, you can use [portals](https://github.com/facebook/react/issues/10309#issuecomment-318433235) or [refs](https://github.com/facebook/react/issues/10309#issuecomment-318434635). +* `ReactDOM.render` and `ReactDOM.unstable_renderSubtreeIntoContainer` now return null if called from inside a lifecycle method. To work around this, you can use [portals](https://github.com/facebook/react/issues/10309#issuecomment-318433235) or [refs](https://github.com/facebook/react/issues/10309#issuecomment-318434635). * `setState`: * Calling `setState` with null no longer triggers an update. This allows you to decide in an updater function if you want to re-render. * Calling `setState` directly in render always causes an update. This was not previously the case. Regardless, you should not be calling setState from render. From 524ffef6cf19a0e4ac549be3eb74a5ad340c36be Mon Sep 17 00:00:00 2001 From: Nik Graf Date: Tue, 10 Oct 2017 23:19:45 +0200 Subject: [PATCH 37/43] Fix blog post content about DOM Attributes --- content/blog/2017-09-08-dom-attributes-in-react-16.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/blog/2017-09-08-dom-attributes-in-react-16.md b/content/blog/2017-09-08-dom-attributes-in-react-16.md index a8ded510..f562457e 100644 --- a/content/blog/2017-09-08-dom-attributes-in-react-16.md +++ b/content/blog/2017-09-08-dom-attributes-in-react-16.md @@ -163,7 +163,7 @@ Below is a detailed list of them. ``` React 15: Converts `NaN`s to strings and passes them through. - React 16: Warns and ignores them. + React 16: Converts `NaN`s to strings and warns about them. While testing this release, we have also [created an automatically generated table](https://github.com/facebook/react/blob/master/fixtures/attribute-behavior/AttributeTableSnapshot.md) for all known attributes to track potential regressions. From 558ae3176a1ae32d5825e290b6f3a118da47c85f Mon Sep 17 00:00:00 2001 From: James Clements Date: Tue, 10 Oct 2017 16:45:26 -0500 Subject: [PATCH 38/43] adds returning multiple elements example to jsx-in-depth guide --- content/docs/jsx-in-depth.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/content/docs/jsx-in-depth.md b/content/docs/jsx-in-depth.md index 7acc3289..00a0e3a8 100644 --- a/content/docs/jsx-in-depth.md +++ b/content/docs/jsx-in-depth.md @@ -308,7 +308,19 @@ You can mix together different types of children, so you can use string literals
``` -A React component can't return multiple React elements, but a single JSX expression can have multiple children, so if you want a component to render multiple things you can wrap it in a `div` like this. +A React component can return multiple React elements: + +```js +render() { + // No need to wrap list items in an extra element! + return [ + // Don't forget the keys :) +
  • First item
  • , +
  • Second item
  • , +
  • Third item
  • , + ]; +} +``` ### JavaScript Expressions as Children From 5f2cadf8657023e331f379b21e8eaa937f26178a Mon Sep 17 00:00:00 2001 From: James Clements Date: Tue, 10 Oct 2017 16:49:46 -0500 Subject: [PATCH 39/43] any elements --- content/docs/jsx-in-depth.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/docs/jsx-in-depth.md b/content/docs/jsx-in-depth.md index 00a0e3a8..9cd73c1c 100644 --- a/content/docs/jsx-in-depth.md +++ b/content/docs/jsx-in-depth.md @@ -308,7 +308,7 @@ You can mix together different types of children, so you can use string literals
    ``` -A React component can return multiple React elements: +A React component can return multiple elements: ```js render() { From f81cf014f59a8aed971b3c28b776e3c33f7db661 Mon Sep 17 00:00:00 2001 From: James Clements Date: Tue, 10 Oct 2017 17:06:12 -0500 Subject: [PATCH 40/43] change wording to reflect array --- content/docs/jsx-in-depth.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/docs/jsx-in-depth.md b/content/docs/jsx-in-depth.md index 9cd73c1c..fafbe64d 100644 --- a/content/docs/jsx-in-depth.md +++ b/content/docs/jsx-in-depth.md @@ -308,7 +308,7 @@ You can mix together different types of children, so you can use string literals
    ``` -A React component can return multiple elements: +A React component can also return an array of elements: ```js render() { From 67dfc2d3f74c31e6c38bfb310f892ae21856b461 Mon Sep 17 00:00:00 2001 From: Sasha Aickin Date: Tue, 10 Oct 2017 19:32:17 -0700 Subject: [PATCH 41/43] Small tweaks to the ReactDOMServer doc. --- content/docs/reference-react-dom-server.md | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/content/docs/reference-react-dom-server.md b/content/docs/reference-react-dom-server.md index cf5ff2d3..cb88a7d5 100644 --- a/content/docs/reference-react-dom-server.md +++ b/content/docs/reference-react-dom-server.md @@ -49,7 +49,9 @@ If you call [`ReactDOM.hydrate()`](/docs/react-dom.html#hydrate) on a node that ReactDOMServer.renderToStaticMarkup(element) ``` -Similar to [`renderToString`](#rendertostring), except this doesn't create extra DOM attributes such as `data-reactid`, that React uses internally. This is useful if you want to use React as a simple static page generator, as stripping away the extra attributes can save lots of bytes. +Similar to [`renderToString`](#rendertostring), except this doesn't create extra DOM attributes that React uses internally, such as `data-reactroot`. This is useful if you want to use React as a simple static page generator, as stripping away the extra attributes can save some bytes. + +If you plan to use React on the client to make the markup interactive, do not use this method. Instead, use [`renderToString`](#rendertostring) on the server and [`ReactDOM.hydrate()`](/docs/react-dom.html#hydrate) on the client. * * * @@ -59,10 +61,12 @@ Similar to [`renderToString`](#rendertostring), except this doesn't create extra ReactDOMNodeStream.renderToNodeStream(element) ``` -Render a React element to its initial HTML. Returns a [Readable stream](https://nodejs.org/api/stream.html#stream_readable_streams) that outputs an HTML string. The HTML output by this stream is exactly equal to what [`ReactDOMServer.renderToString`](#rendertostring) would return. +Render a React element to its initial HTML. Returns a [Readable stream](https://nodejs.org/api/stream.html#stream_readable_streams) that outputs an HTML string. The HTML output by this stream is exactly equal to what [`ReactDOMServer.renderToString`](#rendertostring) would return. You can use this method to generate HTML on the server and send the markup down on the initial request for faster page loads and to allow search engines to crawl your pages for SEO purposes. + +If you call [`ReactDOM.hydrate()`](/docs/react-dom.html#hydrate) on a node that already has this server-rendered markup, React will preserve it and only attach event handlers, allowing you to have a very performant first-load experience. > Note: -> +> > Server-only. This API is not available in the browser. > > The stream returned from this method will return a byte stream encoded in utf-8. If you need a stream in another encoding, take a look a project like [iconv-lite](https://www.npmjs.com/package/iconv-lite), which provides transform streams for transcoding text. @@ -75,10 +79,14 @@ Render a React element to its initial HTML. Returns a [Readable stream](https:// ReactDOMNodeStream.renderToStaticNodeStream(element) ``` -Similar to [`renderToNodeStream`](#rendertonodestream), except this doesn't create extra DOM attributes such as `data-reactid`, that React uses internally. The HTML output by this stream is exactly equal to what [`ReactDOMServer.renderToStaticMarkup`](#rendertostaticmarkup) would return. +Similar to [`renderToNodeStream`](#rendertonodestream), except this doesn't create extra DOM attributes that React uses internally, such as `data-reactroot`. This is useful if you want to use React as a simple static page generator, as stripping away the extra attributes can save some bytes. + +The HTML output by this stream is exactly equal to what [`ReactDOMServer.renderToStaticMarkup`](#rendertostaticmarkup) would return. + +If you plan to use React on the client to make the markup interactive, do not use this method. Instead, use [`renderToNodeStream`](#rendertonodestream) on the server and [`ReactDOM.hydrate()`](/docs/react-dom.html#hydrate) on the client. > Note: > > Server-only. This API is not available in the browser. -> +> > The stream returned from this method will return a byte stream encoded in utf-8. If you need a stream in another encoding, take a look a project like [iconv-lite](https://www.npmjs.com/package/iconv-lite), which provides transform streams for transcoding text. From 728b6f89d86f3e94d5ae488969897e4c9710c918 Mon Sep 17 00:00:00 2001 From: Fatos Morina Date: Wed, 11 Oct 2017 09:51:04 +0200 Subject: [PATCH 42/43] Hyperlink DRY --- content/docs/thinking-in-react.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/docs/thinking-in-react.md b/content/docs/thinking-in-react.md index 8f3786d8..53caa2b2 100644 --- a/content/docs/thinking-in-react.md +++ b/content/docs/thinking-in-react.md @@ -82,7 +82,7 @@ There are two types of "model" data in React: props and state. It's important to To make your UI interactive, you need to be able to trigger changes to your underlying data model. React makes this easy with **state**. -To build your app correctly, you first need to think of the minimal set of mutable state that your app needs. The key here is DRY: *Don't Repeat Yourself*. Figure out the absolute minimal representation of the state your application needs and compute everything else you need on-demand. For example, if you're building a TODO list, just keep an array of the TODO items around; don't keep a separate state variable for the count. Instead, when you want to render the TODO count, simply take the length of the TODO items array. +To build your app correctly, you first need to think of the minimal set of mutable state that your app needs. The key here is [DRY: *Don't Repeat Yourself*](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself). Figure out the absolute minimal representation of the state your application needs and compute everything else you need on-demand. For example, if you're building a TODO list, just keep an array of the TODO items around; don't keep a separate state variable for the count. Instead, when you want to render the TODO count, simply take the length of the TODO items array. Think of all of the pieces of data in our example application. We have: From 8c04bfc18dba73bbf85d47f4e5ab63fdfd8b3298 Mon Sep 17 00:00:00 2001 From: Nik Graf Date: Wed, 11 Oct 2017 16:26:35 +0200 Subject: [PATCH 43/43] Update 2017-09-08-dom-attributes-in-react-16.md --- content/blog/2017-09-08-dom-attributes-in-react-16.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/blog/2017-09-08-dom-attributes-in-react-16.md b/content/blog/2017-09-08-dom-attributes-in-react-16.md index f562457e..b8953997 100644 --- a/content/blog/2017-09-08-dom-attributes-in-react-16.md +++ b/content/blog/2017-09-08-dom-attributes-in-react-16.md @@ -163,7 +163,7 @@ Below is a detailed list of them. ``` React 15: Converts `NaN`s to strings and passes them through. - React 16: Converts `NaN`s to strings and warns about them. + React 16: Converts `NaN`s to strings and passes them through with a warning. While testing this release, we have also [created an automatically generated table](https://github.com/facebook/react/blob/master/fixtures/attribute-behavior/AttributeTableSnapshot.md) for all known attributes to track potential regressions.