Skip to content

Commit bf7f904

Browse files
authored
Merge pull request #399 from reactjs/sync-49fd7d5f
Sync with reactjs.org @ 49fd7d5
2 parents 1f8057e + 512cb9f commit bf7f904

15 files changed

+51
-36
lines changed

content/blog/2017-09-08-dom-attributes-in-react-16.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ React has always provided a JavaScript-centric API to the DOM. Since React compo
3232
<div tabIndex={-1} />
3333
```
3434

35-
This has not changed. However, the way we enforced it in the past forced us to maintain a whitelist of all valid React DOM attributes in the bundle:
35+
This has not changed. However, the way we enforced it in the past forced us to maintain a allowlist of all valid React DOM attributes in the bundle:
3636

3737
```js
3838
// ...
@@ -47,9 +47,9 @@ This had two downsides:
4747

4848
* You could not [pass a custom attribute](https://github.com/facebook/react/issues/140). This is useful for supplying browser-specific non-standard attributes, trying new DOM APIs, and integrating with opinionated third-party libraries.
4949

50-
* The attribute list kept growing over time, but most React canonical attribute names are already valid in the DOM. Removing most of the whitelist helped us reduce the bundle size a little bit.
50+
* The attribute list kept growing over time, but most React canonical attribute names are already valid in the DOM. Removing most of the allowlist helped us reduce the bundle size a little bit.
5151

52-
With the new approach, both of these problems are solved. With React 16, you can now pass custom attributes to all HTML and SVG elements, and React doesn't have to include the whole attribute whitelist in the production version.
52+
With the new approach, both of these problems are solved. With React 16, you can now pass custom attributes to all HTML and SVG elements, and React doesn't have to include the whole attribute allowlist in the production version.
5353

5454
**Note that you should still use the canonical React naming for known attributes:**
5555

content/community/conferences.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,21 @@ Do you know of a local React.js conference? Add it here! (Please keep the list c
1212

1313
## Upcoming Conferences {#upcoming-conferences}
1414

15-
### React Next 2020 {#react-next-2020}
16-
December 1-2, 2020 - remote event
15+
### React fwdays’21 {#react-fwdays-2021}
16+
March 27, 2021 - remote event
1717

18-
[Website](https://react-next.com/) - [Twitter](https://twitter.com/reactnext) - [Facebook](https://www.facebook.com/ReactNext2016/)
18+
[Website](https://fwdays.com/en/event/react-fwdays-2021) - [Twitter](https://twitter.com/fwdays) - [Facebook](https://www.facebook.com/events/1133828147054286) - [LinkedIn](https://www.linkedin.com/events/reactfwdays-21onlineconference6758046347334582273) - [Meetup](https://www.meetup.com/ru-RU/Fwdays/events/275764431/)
1919

2020
### React Summit - Remote Edition 2021 {#react-summit-remote-2021}
2121
April 14-16, 2021, 7am PST / 10am EST / 4pm CEST - remote event
2222

2323
[Website](https://remote.reactsummit.com) - [Twitter](https://twitter.com/reactsummit) - [Facebook](https://www.facebook.com/reactamsterdam) - [Videos](https://youtube.com/c/ReactConferences)
2424

25+
### React Case Study Festival 2021 {#react-case-study-festival-2021}
26+
April 27-28, 2021 - remote event
27+
28+
[Website](https://link.geekle.us/react/offsite) - [LinkedIn](https://www.linkedin.com/events/reactcasestudyfestival6721300943411015680/) - [Facebook](https://www.facebook.com/events/255715435820203)
29+
2530
### render(ATL) 2021 {#render-atlanta-2021}
2631
September 13-15, 2021. Atlanta, GA, USA
2732

@@ -34,6 +39,11 @@ November 12-13, 2021 in Mumbai, India
3439

3540
## Past Conferences {#past-conferences}
3641

42+
### React Next 2020 {#react-next-2020}
43+
December 1-2, 2020 - remote event
44+
45+
[Website](https://react-next.com/) - [Twitter](https://twitter.com/reactnext) - [Facebook](https://www.facebook.com/ReactNext2016/)
46+
3747
### React Conf Brasil 2020 {#react-conf-brasil-2020}
3848
November 21, 2020 - remote event
3949

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/context.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ permalink: docs/context.html
66

77
コンテクストは各階層で手動でプロパティを下に渡すことなく、コンポーネントツリー内でデータを渡す方法を提供します。
88

9-
典型的な React アプリケーションでは、データは props を通してトップダウン(親から子)で渡されますが、アプリケーション内の多くのコンポーネントから必要とされる特定のタイプのプロパティ(例: ロケール設定、UI テーマ)にとっては面倒です。コンテクストはツリーの各階層で明示的にプロパティを渡すことなく、コンポーネント間でこれらの様な値を共有する方法を提供します。
9+
典型的な React アプリケーションでは、データは props を通してトップダウン(親から子)で渡されますが、このようなやり方は、アプリケーション内の多くのコンポーネントから必要とされる特定のタイプのプロパティ(例: ロケール設定、UI テーマ)にとっては面倒です。コンテクストはツリーの各階層で明示的にプロパティを渡すことなく、コンポーネント間でこれらの様な値を共有する方法を提供します。
1010

1111
- [コンテクストをいつ使用すべきか](#when-to-use-context)
1212
- [コンテクストを使用する前に](#before-you-use-context)
@@ -80,7 +80,7 @@ function Page(props) {
8080

8181
この変更により、一番上の Page コンポーネントだけが、`Link``Avatar` コンポーネントの `user``avatarSize` の使い道について知る必要があります。
8282

83-
この*制御の反転*はアプリケーション内で取り回す必要のあるプロパティの量を減らし、ルートコンポーネントにより多くの制御を与えることにより、多くのケースでコードを綺麗にすることができます。しかし、この方法は全てのケースで正しい選択とはなりません:ツリー内の上層に複雑性が移ることは、それら高い階層のコンポーネントをより複雑にして、低い階層のコンポーネントに必要以上の柔軟性を強制します。
83+
この*制御の反転*はアプリケーション内で取り回す必要のあるプロパティの量を減らし、ルートコンポーネントにより多くの制御を与えることにより、多くのケースでコードを綺麗にすることができます。しかし、このような制御の反転がすべてのケースで正しい選択となるわけではありません。ツリー内の上層に複雑性が移ることは、それら高い階層のコンポーネントをより複雑にして、低い階層のコンポーネントに必要以上の柔軟性を強制します。
8484

8585
コンポーネントに対して 1 つの子までという制限はありません。複数の子を渡したり、子のために複数の別々の「スロット」を持つことさえできます。[ドキュメントはここにあります。](/docs/composition-vs-inheritance.html#containment)
8686

@@ -118,7 +118,7 @@ const MyContext = React.createContext(defaultValue);
118118

119119
コンテクストオブジェクトを作成します。React がこのコンテクストオブジェクトが登録されているコンポーネントをレンダーする場合、ツリー内の最も近い上位の一致する `Provider` から現在のコンテクストの値を読み取ります。
120120

121-
`defaultValue` 引数は、コンポーネントがツリー内の上位に一致するプロバイダを持っていない場合のみ使用されます。これは、ラップしない単独でのコンポーネントのテストにて役に立ちます。補足: `undefined` をプロバイダの値として渡しても、コンシューマコンポーネントが `defaultValue` を使用することはありません。
121+
`defaultValue` 引数は、コンポーネントがツリー内の上位に対応するプロバイダを持っていない場合のみ使用されます。このようなデフォルト値は、ラップしない単独でのコンポーネントのテストにて役に立ちます。補足: `undefined` をプロバイダの値として渡しても、コンシューマコンポーネントが `defaultValue` を使用することはありません。
122122

123123
### `Context.Provider` {#contextprovider}
124124

@@ -188,7 +188,7 @@ class MyClass extends React.Component {
188188
</MyContext.Consumer>
189189
```
190190

191-
コンテクストの変更を購読する React コンポーネントです。[関数コンポーネント](/docs/components-and-props.html#function-and-class-components)内でコンテクストを購読することができます。
191+
コンテクストの変更を購読する React コンポーネントです。このコンポーネントを使うことで、[関数コンポーネント](/docs/components-and-props.html#function-and-class-components)内でコンテクストを購読することができます。
192192

193193
[function as a child](/docs/render-props.html#using-props-other-than-render) が必要です。この関数は現在のコンテクストの値を受け取り、React ノードを返します。この関数に渡される引数 `value` は、ツリー内の上位で一番近いこのコンテクスト用のプロバイダの `value` プロパティと等しくなります。このコンテクスト用のプロバイダが上位に存在しない場合、引数の `value``createContext()` から渡された `defaultValue` と等しくなります。
194194

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
コンポーネントが props を UI に変換するのに対して、高階コンポーネントはコンポーネントを別のコンポーネントに変換します。
1616

17-
HOC は Redux における [`connect`](https://github.com/reactjs/react-redux/blob/master/docs/api/connect.md#connectmapstatetoprops-mapdispatchtoprops-mergeprops-options) や Relay における [`createFragmentContainer`](http://facebook.github.io/relay/docs/en/fragment-container.html) のように、サードパーティ製の React ライブラリでは一般的なものです。
17+
HOC は Redux における [`connect`](https://github.com/reactjs/react-redux/blob/master/docs/api/connect.md#connectmapstatetoprops-mapdispatchtoprops-mergeprops-options) や Relay における [`createFragmentContainer`](https://relay.dev/docs/v10.1.3/fragment-container/#createfragmentcontainer) のように、サードパーティ製の React ライブラリでは一般的なものです。
1818

1919
このドキュメントでは、なぜ高階コンポーネントが便利で、自身でどのように記述するのかを説明します。
2020

content/docs/hooks-rules.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ prev: hooks-effect.html
1212

1313
### フックを呼び出すのはトップレベルのみ {#only-call-hooks-at-the-top-level}
1414

15-
**フックをループや条件分岐、あるいはネストされた関数内で呼び出してはいけません。**代わりに、あなたの React の関数のトップレベルでのみ呼び出してください。これを守ることで、コンポーネントがレンダーされる際に毎回同じ順番で呼び出されるということが保証されます。これが、複数回 `useState``useEffect` が呼び出された場合でも React がフックの状態を正しく保持するための仕組みです(興味がある場合は[ページ下部](#explanation)で詳しく説明しています)。
15+
**フックをループや条件分岐、あるいはネストされた関数内で呼び出してはいけません。**代わりに、あなたの React の関数のトップレベルでのみ、あらゆる早期 return 文よりも前の場所で呼び出してください。これを守ることで、コンポーネントがレンダーされる際に毎回同じ順番で呼び出されるということが保証されます。これが、複数回 `useState``useEffect` が呼び出された場合でも React がフックの状態を正しく保持するための仕組みです(興味がある場合は[ページ下部](#explanation)で詳しく説明しています)。
1616

1717
### フックを呼び出すのは React の関数内のみ {#only-call-hooks-from-react-functions}
1818

content/docs/how-to-contribute.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ React リポジトリをクローンしたあと、`yarn` コマンドで依存
132132

133133
変更を試す一番簡単な方法は `yarn build react/index,react-dom/index --type=UMD` を実行し、`fixtures/packaging/babel-standalone/dev.html` を開くことです。このファイルは `build` フォルダの `react.development.js` を既に使用しているので、変更が反映されます。
134134

135-
あなたの加えた変更を既存の React プロジェクトで試したい場合、`build/dist/react.development.js``build/dist/react-dom.development.js`、もしくは他のビルドされたファイルをあなたのアプリケーションにコピーして安定版の代わりに使用することができます。
135+
あなたの加えた変更を既存の React プロジェクトで試したい場合、`build/node_modules/react/umd/react.development.js``build/node_modules/react-dom/umd/react-dom.development.js`、もしくは他のビルドされたファイルをあなたのアプリケーションにコピーして安定版の代わりに使用することができます。
136136

137137
もし、npm 版の React を使用している場合は `react``react-dom` を依存関係から削除し、`yarn link` を使用してそれらがローカルの `build` フォルダを指すようにしてください。ビルド時には **`--type=UMD` の代わりに `--type=NODE` を渡す必要があることに注意してください**。また `scheduler` パッケージもビルドする必要があります:
138138

content/docs/reference-react.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ const MyComponent = React.memo(function MyComponent(props) {
128128

129129
もしあるコンポーネントが同じ props を与えられたときに同じ結果をレンダーするなら、結果を記憶してパフォーマンスを向上させるためにそれを `React.memo` でラップすることができます。つまり、React はコンポーネントのレンダーをスキップし、最後のレンダー結果を再利用します。
130130

131-
`React.memo` は props の変更のみをチェックします。`React.memo` でラップしているあなたのコンポーネントがその実装内で [`useState`](/docs/hooks-state.html)[`useContext`](/docs/hooks-reference.html#usecontext) フックを使っている場合、state やコンテクストの変化に応じた再レンダーは発生します。
131+
`React.memo` は props の変更のみをチェックします。`React.memo` でラップしているあなたのコンポーネントがその実装内で [`useState`](/docs/hooks-state.html)[`useReducer`](/docs/hooks-reference.html#usereducer)[`useContext`](/docs/hooks-reference.html#usecontext) フックを使っている場合、state やコンテクストの変化に応じた再レンダーは発生します。
132132

133133
デフォルトでは props オブジェクト内の複雑なオブジェクトは浅い比較のみが行われます。比較を制御したい場合は 2 番目の引数でカスタム比較関数を指定できます。
134134

content/docs/strict-mode.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ React 16.3 ではこれらの不都合なく文字列 ref の利点を活かせ
5555

5656
React ではかつてクラスのインスタンスを元にツリー内の DOM ノードを見つける `findDOMNode` がサポートされていました。通常、[DOM ノードに ref を付与する](/docs/refs-and-the-dom.html#creating-refs)ことができるため、このような操作は必要ありません。
5757

58-
`findDOMNode` はクラスコンポーネントでも使用可能でしたが、これによって親要素が特定の子要素がレンダーされるのを要求する状況が許されてしまい、抽象レベルを破壊してしまっていました。このことにより、親要素が子の DOM ノードにまで踏み込んでしまう可能性があるためにコンポーネントの詳細な実装を変更できない、というようなリファクタリングの危険要因を生み出してしまっていました。`findDOMNode` は 1 番目の子要素しか返しませんが、フラグメントを使うことによりコンポーネントは複数の DOM ノードをレンダーできます。`findDOMNode` は 1 回限りの読みこみ API で、問い合わせたときの解答しか返しません。もし子コンポーネントが別のノードをレンダーしていても、この変化を管理することはできません。このため、`findDOMNode` はコンポーネントが絶対に変化することのない単一の DOM ノードのみを返す場合のみ有効といえます
58+
`findDOMNode` はクラスコンポーネントでも使用可能でしたが、これによって親要素が特定の子要素がレンダーされるのを要求する状況が許されてしまい、抽象レベルを破壊してしまっていました。このことにより、親要素が子の DOM ノードにまで踏み込んでしまう可能性があるためにコンポーネントの詳細な実装を変更できない、というようなリファクタリングの危険要因を生み出してしまっていました。`findDOMNode` は 1 番目の子要素しか返しませんが、フラグメントを使うことによりコンポーネントは複数の DOM ノードをレンダーできます。更に `findDOMNode` はその場限りの読みこみ API であり、問い合わせたときにしか結果を返しません。もし子コンポーネントが別のノードをレンダーした場合に、この変化を捕捉することはできません。これらのため、`findDOMNode` はコンポーネントが絶対に変化することのない単一の DOM ノードのみを返す場合のみ有効なものでした
5959

6060
代わりに [ref のフォワーディング](/docs/forwarding-refs.html#forwarding-refs-to-dom-components)を使うことで、カスタムコンポーネントに ref を渡し、DOM にまで引き継ぐことでこれを明示的にすることができます。
6161

content/docs/testing-recipes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,20 +465,20 @@ import { act } from "react-dom/test-utils";
465465
466466
import Card from "./card";
467467
468-
jest.useFakeTimers();
469-
470468
let container = null;
471469
beforeEach(() => {
472470
// setup a DOM element as a render target
473471
container = document.createElement("div");
474472
document.body.appendChild(container);
473+
jest.useFakeTimers();
475474
});
476475
477476
afterEach(() => {
478477
// cleanup on exiting
479478
unmountComponentAtNode(container);
480479
container.remove();
481480
container = null;
481+
jest.useRealTimers();
482482
});
483483
484484
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: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@
4747
"normalize.css": "^8.0.0",
4848
"prettier": "^1.7.4",
4949
"prismjs": "^1.15.0",
50-
"react": "^17.0.1",
51-
"react-dom": "^17.0.1",
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://ja.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://ja.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)