Skip to content

Commit 6745fda

Browse files
authored
Merge pull request #123 from reactjs/sync-968f0915
Sync with reactjs.org @ 968f091
2 parents b20f531 + 2531ac4 commit 6745fda

File tree

11 files changed

+35
-51
lines changed

11 files changed

+35
-51
lines changed

content/blog/2020-10-20-react-v17.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ React 17 supports the [new JSX transform](/blog/2020/09/22/introducing-the-new-j
5858

5959
## React Native {#react-native}
6060

61-
React Native has a separate release schedule. We currently expect the support for React 17 to land in React Native 0.65, but the exact version is subject to change. As always, you can track the release discussions on the React Native Community releases [issue tracker](https://github.com/react-native-community/releases).
61+
React Native has a separate release schedule. We landed the support for React 17 in React Native 0.64. As always, you can track the release discussions on the React Native Community releases [issue tracker](https://github.com/react-native-community/releases).
6262

6363
## Installation {#installation}
6464

content/community/meetups.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ Do you have a local React.js meetup? Add it here! (Please keep the list alphabet
5050
* [Ottawa, ON](https://www.meetup.com/Ottawa-ReactJS-Meetup/)
5151
* [Toronto, ON](https://www.meetup.com/Toronto-React-Native/events/)
5252

53+
## Chile {#chile}
54+
* [Santiago](https://www.meetup.com/es-ES/react-santiago/)
55+
5356
## China {#china}
5457
* [Beijing](https://www.meetup.com/Beijing-ReactJS-Meetup/)
5558

content/docs/higher-order-components.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const EnhancedComponent = higherOrderComponent(WrappedComponent);
1414

1515
Whereas a component transforms props into UI, a higher-order component transforms a component into another component.
1616

17-
HOCs are common in third-party React libraries, such as Redux's [`connect`](https://github.com/reduxjs/react-redux/blob/master/docs/api/connect.md#connect) and Relay's [`createFragmentContainer`](http://facebook.github.io/relay/docs/en/fragment-container.html).
17+
HOCs are common in third-party React libraries, such as Redux's [`connect`](https://github.com/reduxjs/react-redux/blob/master/docs/api/connect.md#connect) and Relay's [`createFragmentContainer`](https://relay.dev/docs/v10.1.3/fragment-container/#createfragmentcontainer).
1818

1919
In this document, we'll discuss why higher-order components are useful, and how to write your own.
2020

content/docs/optimizing-performance.md

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -156,32 +156,6 @@ You can learn more about this in [webpack documentation](https://webpack.js.org/
156156

157157
Remember that you only need to do this for production builds. You shouldn't apply `TerserPlugin` in development because it will hide useful React warnings, and make the builds much slower.
158158

159-
## Profiling Components with the Chrome Performance Tab {#profiling-components-with-the-chrome-performance-tab}
160-
161-
In the **development** mode, you can visualize how components mount, update, and unmount, using the performance tools in supported browsers. For example:
162-
163-
<center><img src="../images/blog/react-perf-chrome-timeline.png" style="max-width:100%" alt="React components in Chrome timeline" /></center>
164-
165-
To do this in Chrome:
166-
167-
1. Temporarily **disable all Chrome extensions, especially React DevTools**. They can significantly skew the results!
168-
169-
2. Make sure you're running the application in the development mode.
170-
171-
3. Open the Chrome DevTools **[Performance](https://developers.google.com/web/tools/chrome-devtools/evaluate-performance/timeline-tool)** tab and press **Record**.
172-
173-
4. Perform the actions you want to profile. Don't record more than 20 seconds or Chrome might hang.
174-
175-
5. Stop recording.
176-
177-
6. React events will be grouped under the **User Timing** label.
178-
179-
For a more detailed walkthrough, check out [this article by Ben Schwarz](https://calibreapp.com/blog/react-performance-profiling-optimization).
180-
181-
Note that **the numbers are relative so components will render faster in production**. Still, this should help you realize when unrelated UI gets updated by mistake, and how deep and how often your UI updates occur.
182-
183-
Currently Chrome, Edge, and IE are the only browsers supporting this feature, but we use the standard [User Timing API](https://developer.mozilla.org/en-US/docs/Web/API/User_Timing_API) so we expect more browsers to add support for it.
184-
185159
## Profiling Components with the DevTools Profiler {#profiling-components-with-the-devtools-profiler}
186160

187161
`react-dom` 16.5+ and `react-native` 0.57+ provide enhanced profiling capabilities in DEV mode with the React DevTools Profiler.
@@ -199,6 +173,11 @@ If you haven't yet installed the React DevTools, you can find them here:
199173
> A production profiling bundle of `react-dom` is also available as `react-dom/profiling`.
200174
> Read more about how to use this bundle at [fb.me/react-profiling](https://fb.me/react-profiling)
201175
176+
> Note
177+
>
178+
> Before React 17, we use the standard [User Timing API](https://developer.mozilla.org/en-US/docs/Web/API/User_Timing_API) to profile components with the chrome performance tab.
179+
> For a more detailed walkthrough, check out [this article by Ben Schwarz](https://calibreapp.com/blog/react-performance-profiling-optimization).
180+
202181
## Virtualize Long Lists {#virtualize-long-lists}
203182

204183
If your application renders long lists of data (hundreds or thousands of rows), we recommended using a technique known as "windowing". This technique only renders a small subset of your rows at any given time, and can dramatically reduce the time it takes to re-render the components as well as the number of DOM nodes created.

content/docs/strict-mode.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Since object refs were largely added as a replacement for string refs, strict mo
5555

5656
React used to support `findDOMNode` to search the tree for a DOM node given a class instance. Normally you don't need this because you can [attach a ref directly to a DOM node](/docs/refs-and-the-dom.html#creating-refs).
5757

58-
`findDOMNode` can also be used on class components but this was breaking abstraction levels by allowing a parent to demand that certain children was rendered. It creates a refactoring hazard where you can't change the implementation details of a component because a parent might be reaching into its DOM node. `findDOMNode` only returns the first child, but with the use of Fragments, it is possible for a component to render multiple DOM nodes. `findDOMNode` is a one time read API. It only gave you an answer when you asked for it. If a child component renders a different node, there is no way to handle this change. Therefore `findDOMNode` only worked if components always return a single DOM node that never changes.
58+
`findDOMNode` can also be used on class components but this was breaking abstraction levels by allowing a parent to demand that certain children were rendered. It creates a refactoring hazard where you can't change the implementation details of a component because a parent might be reaching into its DOM node. `findDOMNode` only returns the first child, but with the use of Fragments, it is possible for a component to render multiple DOM nodes. `findDOMNode` is a one time read API. It only gave you an answer when you asked for it. If a child component renders a different node, there is no way to handle this change. Therefore `findDOMNode` only worked if components always return a single DOM node that never changes.
5959

6060
You can instead make this explicit by passing a ref to your custom component and pass that along to the DOM using [ref forwarding](/docs/forwarding-refs.html#forwarding-refs-to-dom-components).
6161

content/docs/testing-recipes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,20 +467,20 @@ import { act } from "react-dom/test-utils";
467467
468468
import Card from "./card";
469469
470-
jest.useFakeTimers();
471-
472470
let container = null;
473471
beforeEach(() => {
474472
// cài đặt một DOM element như là target cho render
475473
container = document.createElement("div");
476474
document.body.appendChild(container);
475+
jest.useFakeTimers();
477476
});
478477
479478
afterEach(() => {
480479
// dọn dẹp lúc thoát
481480
unmountComponentAtNode(container);
482481
container.remove();
483482
container = null;
483+
jest.useRealTimers();
484484
});
485485
486486
it("should select null after timing out", () => {

content/versions.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
- title: '17.0.2'
2+
changelog: https://github.com/facebook/react/blob/master/CHANGELOG.md#1702-march-22-2021
13
- title: '17.0.1'
24
changelog: https://github.com/facebook/react/blob/master/CHANGELOG.md#1701-october-22-2020
35
- title: '17.0.0'

examples/context/reference-caveats-solution.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ class App extends React.Component {
1010
render() {
1111
// highlight-range{2}
1212
return (
13-
<Provider value={this.state.value}>
13+
<MyContext.Provider value={this.state.value}>
1414
<Toolbar />
15-
</Provider>
15+
</MyContext.Provider>
1616
);
1717
}
1818
}

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@
4646
"mdast-util-to-string": "^1.0.5",
4747
"normalize.css": "^8.0.0",
4848
"prettier": "^1.7.4",
49-
"prismjs": "^1.23.0",
50-
"react": "^17.0.1",
51-
"react-dom": "^17.0.1",
49+
"prismjs": "^1.15.0",
50+
"react": "^17.0.2",
51+
"react-dom": "^17.0.2",
5252
"react-helmet": "^5.2.0",
5353
"react-live": "1.8.0-0",
5454
"remarkable": "^1.7.1",
@@ -58,7 +58,7 @@
5858
"unist-util-visit": "^1.1.3"
5959
},
6060
"engines": {
61-
"node": "12.x.x || 14.x.x",
61+
"node": "12.x.x || 14.x.x || 15.x.x",
6262
"yarn": "^1.3.2"
6363
},
6464
"homepage": "https://reactjs.org/",

src/site-constants.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// NOTE: We can't just use `location.toString()` because when we are rendering
99
// the SSR part in node.js we won't have a proper location.
1010
const urlRoot = 'https://reactjs.org';
11-
const version = '17.0.1';
11+
const version = '17.0.2';
1212
const babelURL = 'https://unpkg.com/babel-standalone@6.26.0/babel.min.js';
1313

1414
export {babelURL, urlRoot, version};

0 commit comments

Comments
 (0)