Skip to content

Commit f108283

Browse files
merging all conflicts
2 parents 8c49856 + ddbd064 commit f108283

31 files changed

+1245
-46
lines changed

content/blog/2018-03-27-update-on-async-rendering.md

+9
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@ These lifecycle methods have often been misunderstood and subtly misused; furthe
2525

2626
We maintain over 50,000 React components at Facebook, and we don't plan to rewrite them all immediately. We understand that migrations take time. We will take the gradual migration path along with everyone in the React community.
2727

28+
If you don't have the time to migrate or test these components, we recommend running a ["codemod"](https://medium.com/@cpojer/effective-javascript-codemods-5a6686bb46fb) script that renames them automatically:
29+
30+
```bash
31+
cd your_project
32+
npx react-codemod rename-unsafe-lifecycles
33+
```
34+
35+
Learn more about this codemod on the [16.9.0 release post.](https://reactjs.org/blog/2019/08/08/react-v16.9.0.html#renaming-unsafe-lifecycle-methods)
36+
2837
---
2938

3039
## Migrating from Legacy Lifecycles {#migrating-from-legacy-lifecycles}

content/blog/2018-11-27-react-16-roadmap.md

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ author: [gaearon]
44
---
55

66
You might have heard about features like "Hooks", "Suspense", and "Concurrent Rendering" in the previous blog posts and talks. In this post, we'll look at how they fit together and the expected timeline for their availability in a stable release of React.
7+
8+
> An Update from August, 2019
9+
>
10+
> You can find an update to this roadmap in the [React 16.9 release blog post](/blog/2019/08/08/react-v16.9.0.html#an-update-to-the-roadmap).
11+
712

813
## tl;dr {#tldr}
914

content/blog/2019-02-06-react-v16.8.0.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Even while Hooks were in alpha, the React community created many interesting [ex
5050

5151
## Testing Hooks {#testing-hooks}
5252

53-
We have added a new API called `ReactTestUtils.act()` in this release. It ensures that the behavior in your tests matches what happens in the browser more closely. We recommend to wrap any code rendering and triggering updates to your components into `act()` calls. Testing libraries can also wrap their APIs with it (for example, [`react-testing-library`](https://github.com/kentcdodds/react-testing-library)'s `render` and `fireEvent` utilities do this).
53+
We have added a new API called `ReactTestUtils.act()` in this release. It ensures that the behavior in your tests matches what happens in the browser more closely. We recommend to wrap any code rendering and triggering updates to your components into `act()` calls. Testing libraries can also wrap their APIs with it (for example, [`react-testing-library`](https://testing-library.com/react)'s `render` and `fireEvent` utilities do this).
5454

5555
For example, the counter example from [this page](/docs/hooks-effect.html) can be tested like this:
5656

@@ -95,7 +95,7 @@ The calls to `act()` will also flush the effects inside of them.
9595

9696
If you need to test a custom Hook, you can do so by creating a component in your test, and using your Hook from it. Then you can test the component you wrote.
9797

98-
To reduce the boilerplate, we recommend using [`react-testing-library`](https://git.io/react-testing-library) which is designed to encourage writing tests that use your components as the end users do.
98+
To reduce the boilerplate, we recommend using [`react-testing-library`](https://testing-library.com/react) which is designed to encourage writing tests that use your components as the end users do.
9999

100100
## Thanks {#thanks}
101101

content/blog/2019-08-08-react-v16.9.0.md

+241
Large diffs are not rendered by default.

content/community/articles.md

+1
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ permalink: community/articles.html
1313
- [Timeline for Learning React](https://daveceddia.com/timeline-for-learning-react/) - Dave Ceddia's recommended timeline for learning React and the React ecosystem.
1414
- [Simple React Development in 2017](https://hackernoon.com/simple-react-development-in-2017-113bd563691f) - Joshua Comeau's guide to showcase how easy it can be to start modern React development.
1515
- [Visual Guide to State in React](https://daveceddia.com/visual-guide-to-state-in-react/) - Dave Ceddia's visual guide to React state.
16+
- [The Hands-On Guide to Learning React Hooks](https://www.telerik.com/kendo-react-ui/react-hooks-guide/)

content/community/conferences.md

+5
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ 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 Conf Iran 2019 {#react-conf-iran-2019}
16+
August 29, 2019. Tehran, Iran.
17+
18+
[Website](https://reactconf.ir/) - [Twitter](https://twitter.com/reactconf_ir) - [Instagram](https://www.instagram.com/reactconf/)
19+
1520
### React Rally 2019 {#react-rally-2019}
1621
August 22-23, 2019. Salt Lake City, USA.
1722

content/community/meetups.md

+6
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Do you have a local React.js meetup? Add it here! (Please keep the list alphabet
2222
## Brazil {#brazil}
2323
* [Belo Horizonte](https://www.meetup.com/reactbh/)
2424
* [Curitiba](https://www.meetup.com/pt-br/ReactJS-CWB/)
25+
* [Joinville](https://www.meetup.com/pt-BR/React-Joinville/)
2526
* [Rio de Janeiro](https://www.meetup.com/pt-BR/React-Rio-de-Janeiro/)
2627
* [São Paulo](https://www.meetup.com/pt-BR/ReactJS-SP/)
2728

@@ -107,8 +108,12 @@ Do you have a local React.js meetup? Add it here! (Please keep the list alphabet
107108
## Scotland (UK) {#scotland-uk}
108109
* [Edinburgh](https://www.meetup.com/React-Scotland/)
109110

111+
## Singapore {#singapore}
112+
* [Singapore - React Knowledgeable](https://reactknowledgeable.org/)
113+
110114
## Spain {#spain}
111115
* [Barcelona](https://www.meetup.com/ReactJS-Barcelona/)
116+
* [Canarias](https://www.meetup.com/React-Canarias/)
112117

113118
## Sweden {#sweden}
114119
* [Goteborg](https://www.meetup.com/ReactJS-Goteborg/)
@@ -130,6 +135,7 @@ Do you have a local React.js meetup? Add it here! (Please keep the list alphabet
130135
* [Leesburg, VA - ReactJS](https://www.meetup.com/React-NOVA/)
131136
* [Los Angeles, CA - ReactJS](https://www.meetup.com/socal-react/)
132137
* [Los Angeles, CA - React Native](https://www.meetup.com/React-Native-Los-Angeles/)
138+
* [Miami, FL - ReactJS](https://www.meetup.com/React-Miami/)
133139
* [Nashville, TN - ReactJS](https://www.meetup.com/NashReact-Meetup/)
134140
* [New York, NY - ReactJS](https://www.meetup.com/NYC-Javascript-React-Group/)
135141
* [New York, NY - React Ladies](https://www.meetup.com/React-Ladies/)

content/community/nav.yml

-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@
3434
title: Model Management
3535
- id: data-fetching
3636
title: Data Fetching
37-
- id: testing
38-
title: Testing
3937
- id: ui-components
4038
title: UI Components
4139
- id: misc

content/community/tools-testing.md

-13
This file was deleted.

content/community/videos.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@ Facebook engineers Bill Fisher and Jing Chen talk about Flux and React at Forwar
5353
### Going Big with React {#going-big-with-react}
5454

5555
Areeb Malik investigates how React performs in a high stress situation, and how it helped his team build safe code on a massive scale - (2014 - 0h31m).
56-
[![going big with React](https://i.vimeocdn.com/video/481670116_650.jpg)]
57-
56+
<iframe title="Areeb Malik : Going big with React" width="650" height="366" src="https://www.youtube-nocookie.com/embed/9qcBlN6-qwY" frameborder="0" allowfullscreen></iframe>
5857

5958
### Rethinking Best Practices {#rethinking-best-practices}
6059

content/docs/addons-test-utils.md

+10
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,13 @@ it('can render and update a counter', () => {
122122
});
123123
```
124124

125+
<<<<<<< HEAD
125126
DOM イベントのディスパッチは、DOM コンテナが `document` に追加されたときだけ動作することを忘れないでください。[`react-testing-library`](https://github.com/kentcdodds/react-testing-library) のようなヘルパーを使えばボイラープレートのコードを減らせます。
127+
=======
128+
- Don't forget that dispatching DOM events only works when the DOM container is added to the `document`. You can use a library like [React Testing Library](https://testing-library.com/react) to reduce the boilerplate code.
129+
130+
- The [`recipes`](/docs/recipes.html) document contains more details on how `act()` behaves, with examples and usage.
131+
>>>>>>> ddbd064d41d719f9ec0c2f6a4227f797a5828310
126132
127133
* * *
128134

@@ -139,7 +145,11 @@ mockComponent(
139145

140146
> 補足:
141147
>
148+
<<<<<<< HEAD
142149
> `mockComponent()` はレガシーな API です。その代わりとして [shallow rendering](/docs/test-utils.html#shallow-rendering)[`jest.mock()`](https://facebook.github.io/jest/docs/en/tutorial-react-native.html#mock-native-modules-using-jestmock) の使用をおすすめします。
150+
=======
151+
> `mockComponent()` is a legacy API. We recommend using [`jest.mock()`](https://facebook.github.io/jest/docs/en/tutorial-react-native.html#mock-native-modules-using-jestmock) instead.
152+
>>>>>>> ddbd064d41d719f9ec0c2f6a4227f797a5828310
143153
144154
* * *
145155

content/docs/code-splitting.md

+9
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,19 @@ permalink: docs/code-splitting.html
66

77
## バンドル {#bundling}
88

9+
<<<<<<< HEAD
910
多くの React アプリケーションは、[Webpack](https://webpack.js.org/)[Browserify](http://browserify.org/) などの
1011
ツールを使ってファイルを「バンドル」しています。
1112
バンドルはインポートされたファイルをたどって、それらを 1 つのファイルにまとめるプロセスです。
1213
このバンドルされたファイルを Web ページ内に置くことによって、アプリ全体を一度に読み込むことができます。
14+
=======
15+
Most React apps will have their files "bundled" using tools like
16+
[Webpack](https://webpack.js.org/), [Rollup](https://rollupjs.org/) or
17+
[Browserify](http://browserify.org/).
18+
Bundling is the process of following imported files and merging them into a
19+
single file: a "bundle". This bundle can then be included on a webpage to load
20+
an entire app at once.
21+
>>>>>>> ddbd064d41d719f9ec0c2f6a4227f797a5828310
1322
1423
#### 例 {#example}
1524

content/docs/error-boundaries.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ class ErrorBoundary extends React.Component {
3636
return { hasError: true };
3737
}
3838
39-
componentDidCatch(error, info) {
39+
componentDidCatch(error, errorInfo) {
4040
// You can also log the error to an error reporting service
41-
logErrorToMyService(error, info);
41+
logErrorToMyService(error, errorInfo);
4242
}
4343
4444
render() {

content/docs/faq-styling.md

+4
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,8 @@ _注意:この機能は React の一部ではありません。サードパー
4848

4949
### React でアニメーションは使えますか? {#can-i-do-animations-in-react}
5050

51+
<<<<<<< HEAD
5152
React を使ってアニメーションを動かすことは可能です。例として、[React Transition Group](https://reactcommunity.org/react-transition-group/)[React Motion](https://github.com/chenglou/react-motion) をご覧ください。
53+
=======
54+
React can be used to power animations. See [React Transition Group](https://reactcommunity.org/react-transition-group/) and [React Motion](https://github.com/chenglou/react-motion) or [React Spring](https://github.com/react-spring/react-spring), for example.
55+
>>>>>>> ddbd064d41d719f9ec0c2f6a4227f797a5828310

content/docs/hooks-effect.md

+1
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ function Example() {
131131
useEffect(() => {
132132
document.title = `You clicked ${count} times`;
133133
});
134+
}
134135
```
135136

136137
ここでは `count` という state 変数を宣言し、次に副作用を使うことを React に伝えています。`useEffect` フックには関数を渡しています。この関数こそが副作用関数です。この副作用関数内で `document.title` というブラウザ API を使ってドキュメントのタイトルを設定しています。副作用関数は関数スコープ内にあるため最新の `count` の値は副作用内から参照可能です。React がコンポーネントをレンダーする際に React はこの副作用を覚えておき、DOM を更新した後に呼び出します。これは初回を含む毎回のレンダー時に発生します。

content/docs/hooks-faq.md

+24
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,13 @@ React Native はバージョン 0.59 以降でフックをサポートします
106106

107107
これまでと同様に全く同じ API を使用し続けることができます。それらは動作し続けます。
108108

109+
<<<<<<< HEAD
109110
将来的には、これらのライブラリの新バージョンが、例えば `useRedux()``useRouter()` のようなカスタムフックをエクスポートし、ラッパコンポーネントなしで同様の機能が使えるようになるかもしれません。
111+
=======
112+
React Redux since v7.1.0 [supports Hooks API](https://react-redux.js.org/api/hooks) and exposes hooks like `useDispatch` or `useSelector`.
113+
114+
Libraries like React Router might support hooks in the future.
115+
>>>>>>> ddbd064d41d719f9ec0c2f6a4227f797a5828310
110116
111117
### フックは静的型付けと組み合わせてうまく動きますか? {#do-hooks-work-with-static-typing}
112118

@@ -118,7 +124,15 @@ React Native はバージョン 0.59 以降でフックをサポートします
118124

119125
React の観点から見れば、フックを使ったコンポーネントは単なる普通のコンポーネントです。あなたのテストソリューションが React の内部動作に依存しているのでない場合、フックを使ったコンポーネントのテストのやり方は、あなたが普段コンポーネントをテストしているやり方と変わらないはずです。
120126

127+
<<<<<<< HEAD
121128
例えばこのようなカウンタコンポーネントがあるとしましょう:
129+
=======
130+
>Note
131+
>
132+
>[Testing Recipes](/docs/testing-recipes.html) include many examples that you can copy and paste.
133+
134+
For example, let's say we have this counter component:
135+
>>>>>>> ddbd064d41d719f9ec0c2f6a4227f797a5828310
122136
123137
```js
124138
function Example() {
@@ -180,7 +194,13 @@ it('can render and update a counter', () => {
180194

181195
カスタムフックをテストしたい場合は、テスト内でコンポーネントを作って中でそのカスタムフックを使うようにしてください。そうすればそのコンポーネントをテストできます。
182196

197+
<<<<<<< HEAD
183198
ボイラープレートを減らすため、エンドユーザが使うのと同じ形でコンポーネントを使ってテストが記述できるように設計されている、[`react-testing-library`](https://git.io/react-testing-library) の利用をお勧めします。
199+
=======
200+
To reduce the boilerplate, we recommend using [React Testing Library](https://testing-library.com/react) which is designed to encourage writing tests that use your components as the end users do.
201+
202+
For more information, check out [Testing Recipes](/docs/testing-recipes.html).
203+
>>>>>>> ddbd064d41d719f9ec0c2f6a4227f797a5828310
184204
185205
### [Lint ルール](https://www.npmjs.com/package/eslint-plugin-react-hooks) は具体的に何を強制するのですか? {#what-exactly-do-the-lint-rules-enforce}
186206

@@ -562,7 +582,11 @@ useEffect(() => {
562582

563583
>補足
564584
>
585+
<<<<<<< HEAD
565586
> [`eslint-plugin-react-hooks`](https://www.npmjs.com/package/eslint-plugin-react-hooks#installation) パッケージの一部として [`exhaustive-deps`](https://github.com/facebook/react/issues/14920) という ESLint のルールを提供しています。更新の一貫性が保たれていないコンポーネントを見つけるのに役立ちます。
587+
=======
588+
>We provide the [`exhaustive-deps`](https://github.com/facebook/react/issues/14920) ESLint rule as a part of the [`eslint-plugin-react-hooks`](https://www.npmjs.com/package/eslint-plugin-react-hooks#installation) package. It helps you find components that don't handle updates consistently.
589+
>>>>>>> ddbd064d41d719f9ec0c2f6a4227f797a5828310
566590
567591
これがなぜ重要なのか説明します。
568592

content/docs/nav.yml

+18
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,13 @@
5858
- id: optimizing-performance
5959
title: パフォーマンス最適化
6060
- id: portals
61+
<<<<<<< HEAD
6162
title: ポータル
63+
=======
64+
title: Portals
65+
- id: profiler
66+
title: Profiler
67+
>>>>>>> ddbd064d41d719f9ec0c2f6a4227f797a5828310
6268
- id: react-without-es6
6369
title: ES6 なしで React を使う
6470
- id: react-without-jsx
@@ -122,7 +128,19 @@
122128
- id: hooks-reference
123129
title: フック API リファレンス
124130
- id: hooks-faq
131+
<<<<<<< HEAD
125132
title: フックに関するよくある質問
133+
=======
134+
title: Hooks FAQ
135+
- title: Testing
136+
items:
137+
- id: testing
138+
title: Testing Overview
139+
- id: testing-recipes
140+
title: Testing Recipes
141+
- id: testing-environments
142+
title: Testing Environments
143+
>>>>>>> ddbd064d41d719f9ec0c2f6a4227f797a5828310
126144
- title: Contributing
127145
items:
128146
- id: how-to-contribute

0 commit comments

Comments
 (0)