Skip to content

Sync with reactjs.org @ 7e4f503d #322

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 26 commits into from
Mar 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
348a5b2
add suffix / to example url (#1861)
sairam Mar 9, 2020
6f0a32d
Fix tiny typo in is-react-translated-yet blog post (#1833)
Luanf Mar 9, 2020
331eb9d
remove a reference to fbjs from codebase overview (#1806)
koba04 Mar 9, 2020
59ff52a
Remove implicit boolean conversion from homepage example (#1781)
xixixao Mar 9, 2020
16647b3
Update reference-caveats-problem.js (#1626)
ruslanpetrov Mar 9, 2020
d58c947
Update motivation-solution.js (#1625)
ruslanpetrov Mar 9, 2020
7611c77
Remove event from arrow function example (#1542)
traumverloren Mar 9, 2020
970e90a
apostrophe added to Facebooks to show possession (#1297)
maddiekreamer Mar 9, 2020
6f322a4
Update conditional-rendering.md (#1175)
drcmda Mar 9, 2020
420fc31
Update 2018-06-07-you-probably-dont-need-derived-state.md (#1173)
jmxo Mar 9, 2020
c44f4e5
Use const for ref in functional component docs (#1129)
andys8 Mar 9, 2020
98d8c10
Minor grammar edit (syntactic -> syntactical). (#1043)
MendelBak Mar 9, 2020
56cea09
docs(render-props): examples improvement suggestion (#987)
juanmaguitar Mar 9, 2020
d1c1c30
Clarify preferred "props default to true" expr (#495)
davidjb Mar 9, 2020
617021f
Make React.memo documentation more clear (#2762)
Sonicrida Mar 10, 2020
be17215
Updated React and React Native links (#2824)
visshaljagtap Mar 12, 2020
91ffdb0
Upgrade to Node 12 LTS (#2831)
Zeko369 Mar 14, 2020
b3c7540
Update building instructions
gaearon Mar 14, 2020
7fd9496
Updated dates for Render-Atlanta 2020 (#2836)
ThugDebugger Mar 15, 2020
0e7f73c
ReactConf Japan 2020 is cancelled due to COVID-19 (#2839)
visshaljagtap Mar 16, 2020
2ef0ee1
Reorganize information about the plugin (#2835)
eluchsinger Mar 16, 2020
84acbe1
Fix node version in readme (#2837)
Zeko369 Mar 18, 2020
e9cdc81
Update for 16.13.1 (#2845)
acdlite Mar 19, 2020
7e4f503
Remove comma from the portal snippet example (#2852)
ruphaa Mar 21, 2020
b10cecb
Resolve conflicts of yarn.lock, merging all other conflicts
smikitky Mar 24, 2020
81ac565
Resolve conflicts (other than yarn.lock)
smikitky Mar 24, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ version: 2
jobs:
build:
docker:
- image: circleci/node:8
- image: circleci/node:12
steps:
- checkout
- restore_cache:
keys:
- dependencies-{{ checksum "yarn.lock" }}
- dependencies-{{ checksum "yarn.lock" }}
- run:
name: Install
command: yarn install --pure-lockfile
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lts/carbon
lts/erbium
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Netlifyはこれを見てNode.jsのバージョンを変えているようです (carbon = 8.x, erbium = 12.x)

https://docs.netlify.com/configure-builds/manage-dependencies/

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This repo contains the source code and documentation powering [ja.reactjs.org](h
### Prerequisites

1. Git
1. Node: any 8.x version starting with 8.4.0 or greater
1. Node: any 12.x version starting with v12.0.0 or greater
1. Yarn: See [Yarn website for installation instructions](https://yarnpkg.com/lang/en/docs/install/)
1. A fork of the repo (for any contributions)
1. A clone of the [ja.reactjs.org repo](https://github.com/reactjs/ja.reactjs.org) on your local machine
Expand Down
2 changes: 1 addition & 1 deletion content/blog/2013-06-19-community-roundup-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Since the launch we have received a lot of feedback and are actively working on

[Andrew Greig](http://www.andrewgreig.com/) made a blog post that gives a high level description of what React is.

> I have been using Facebooks recently released JavaScript framework called React.js for the last few days and have managed to obtain a rather high level understanding of how it works and formed a good perspective on how it fits in to the entire javascript framework ecosystem.
> I have been using Facebook's recently released JavaScript framework called React.js for the last few days and have managed to obtain a rather high level understanding of how it works and formed a good perspective on how it fits in to the entire javascript framework ecosystem.
>
> Basically, React is not an MVC framework. It is not a replacement for Backbone or Knockout or Angular, instead it is designed to work with existing frameworks and help extend their functionality.
>
Expand Down
2 changes: 1 addition & 1 deletion content/blog/2015-03-26-introducing-react-native.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ For more details, see [Tom Occhino's post on the Facebook Engineering blog](http
>
> *It's worth noting that we're not chasing “write once, run anywhere.” Different platforms have different looks, feels, and capabilities, and as such, we should still be developing discrete apps for each platform, but the same set of engineers should be able to build applications for whatever platform they choose, without needing to learn a fundamentally different set of technologies for each. We call this approach “learn once, write anywhere.”*

To learn more, visit the [React Native website](https://facebook.github.io/react-native/).
To learn more, visit the [React Native website](https://reactnative.dev/).
2 changes: 1 addition & 1 deletion content/blog/2015-05-01-graphql-introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: "GraphQL Introduction"
author: [schrockn]
---

At the React.js conference in late January 2015, we revealed our next major technology in the React family: [Relay](http://facebook.github.io/react/blog/2015/02/20/introducing-relay-and-graphql.html).
At the React.js conference in late January 2015, we revealed our next major technology in the React family: [Relay](/blog/2015/02/20/introducing-relay-and-graphql.html).

Relay is a new way of structuring client applications that co-locates data-fetching requirements and React components. Instead of placing data fetching logic in some other part of the client application – or embedding this logic in a custom endpoint on the server – we instead co-locate a *declarative* data-fetching specification alongside the React component. The language of this declarative specification is GraphQL.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Problems arise when any of these constraints are changed. This typically comes i

A common misconception is that `getDerivedStateFromProps` and `componentWillReceiveProps` are only called when props "change". These lifecycles are called any time a parent component rerenders, regardless of whether the props are "different" from before. Because of this, it has always been unsafe to _unconditionally_ override state using either of these lifecycles. **Doing so will cause state updates to be lost.**

Let’s consider an example to demonstrate the problem. Here is a `EmailInput` component that "mirrors" an email prop in state:
Let’s consider an example to demonstrate the problem. Here is an `EmailInput` component that "mirrors" an email prop in state:
```js
class EmailInput extends Component {
state = { email: this.props.email };
Expand Down
2 changes: 1 addition & 1 deletion content/blog/2018-11-13-react-conf-recap.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ On the morning of Day 2, Andrew Clark and Brian Vaughn presented Concurrent Rend

<iframe width="560" height="315" src="https://www.youtube.com/embed/UcqRXTriUVI" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

In the afternoon, Parashuram N spoke in detail about React Native’s New Architecture, a long-term project that the React Native team has been working on over the past year and [announced in June](https://facebook.github.io/react-native/blog/2018/06/14/state-of-react-native-2018). We’re really excited about the potential of this project to improve performance, simplify interoperability with other libraries, and set a strong foundation for the future of React Native.
In the afternoon, Parashuram N spoke in detail about React Native’s New Architecture, a long-term project that the React Native team has been working on over the past year and [announced in June](https://reactnative.dev/blog/2018/06/14/state-of-react-native-2018). We’re really excited about the potential of this project to improve performance, simplify interoperability with other libraries, and set a strong foundation for the future of React Native.

Now that the conference is over, all 28 conference talks are [available to stream online](https://www.youtube.com/playlist?list=PLPxbbTqCLbGE5AihOSExAa4wUM-P42EIJ). There are tons of great ones from both days. We can’t wait until next year!
2 changes: 1 addition & 1 deletion content/blog/2019-02-23-is-react-translated-yet.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Creating the [sync script](https://github.com/reactjs/reactjs.org-translation/bl

The problem was finding a place for the bot to run. I'm a frontend developer for a reason -- Heroku and its ilk are alien to me and *endlessly* frustrating. In fact, until this past Tuesday, I was running the script by hand on my local machine!

The biggest challenge was space. Each fork of the repo is around 100MB -- which takes minutes to clone on my local machine. We have *32* forks, and the free tiers or most deployment platforms I checked limited you to 512MB of storage.
The biggest challenge was space. Each fork of the repo is around 100MB -- which takes minutes to clone on my local machine. We have *32* forks, and the free tiers of most deployment platforms I checked limited you to 512MB of storage.

After lots of notepad calculations, I found a solution: delete each repo once we've finished the script and limit the concurrency of `sync` scripts that run at once to be within the storage requirements. Luckily, Heroku dynos have a much faster Internet connection and are able to clone even the React repo quickly.

Expand Down
2 changes: 1 addition & 1 deletion content/blog/2019-08-08-react-v16.9.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ These estimates were too optimistic, and we've needed to adjust them.

**tldr:** We shipped Hooks on time, but we're regrouping Concurrent Mode and Suspense for Data Fetching into a single release that we intend to release later this year.

In February, we [shipped a stable 16.8 release](/blog/2019/02/06/react-v16.8.0.html) including React Hooks, with React Native support coming [a month later](https://facebook.github.io/react-native/blog/2019/03/12/releasing-react-native-059). However, we underestimated the follow-up work for this release, including the lint rules, developer tools, examples, and more documentation. This shifted the timeline by a few months.
In February, we [shipped a stable 16.8 release](/blog/2019/02/06/react-v16.8.0.html) including React Hooks, with React Native support coming [a month later](https://reactnative.dev/blog/2019/03/12/releasing-react-native-059). However, we underestimated the follow-up work for this release, including the lint rules, developer tools, examples, and more documentation. This shifted the timeline by a few months.

Now that React Hooks are rolled out, the work on Concurrent Mode and Suspense for Data Fetching is in full swing. The [new Facebook website that's currently in active development](https://twitter.com/facebook/status/1123322299418124289) is built on top of these features. Testing them with real code helped discover and address many issues before they can affect the open source users. Some of these fixes involved an internal redesign of these features, which has also caused the timeline to slip.

Expand Down
2 changes: 1 addition & 1 deletion content/blog/2020-02-26-react-v16.13.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Warning: Cannot update a component from inside the function body of a different

**This warning will help you find application bugs caused by unintentional state changes.** In the rare case that you intentionally want to change the state of another component as a result of rendering, you can wrap the `setState` call into `useEffect`.

### Warnings for conflicting style rules
### Warnings for conflicting style rules {#warnings-for-conflicting-style-rules}

When dynamically applying a `style` that contains longhand and shorthand versions of CSS properties, particular combinations of updates can cause inconsistent styling. For example:

Expand Down
15 changes: 5 additions & 10 deletions content/community/conferences.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ Do you know of a local React.js conference? Add it here! (Please keep the list c

## Upcoming Conferences {#upcoming-conferences}

### ReactConf Japan 2020 {#reactconfjp-2020}
March 21, 2020 in Tokyo, Japan

[Website](https://reactconf.jp/) - [Twitter](https://twitter.com/reactjp)

### Reactathon 2020 {#reactathon-2020}
March 30 - 31, 2020 in San Francisco, CA

Expand All @@ -42,11 +37,6 @@ May 1, 2020. Streamed online on YouTube.

[Website](https://www.bytesized.xyz) - [Twitter](https://twitter.com/bytesizedcode) - [YouTube](https://www.youtube.com/channel/UC046lFvJZhiwSRWsoH8SFjg)

### render(ATL) 2020 {#render-atlanta-2020}
May 4-6, 2020. Atlanta, GA, USA.

[Website](https://renderatl.com) - [Twitter](https://twitter.com/renderATL) - [Instagram](https://www.instagram.com/renderatl/) - [Facebook](https://www.facebook.com/renderatl/)

### ReactEurope 2020 {#reacteurope-2020}
May 14-15, 2020 in Paris, France

Expand Down Expand Up @@ -82,6 +72,11 @@ July 29-30, 2020. Portland, Oregon, USA.

[Website](https://infinite.red/ChainReactConf) - [Twitter](https://twitter.com/ChainReactConf)

### render(ATL) 2020 {#render-atlanta-2020}
August 24-26, 2020. Atlanta, GA, USA.

[Website](https://renderatl.com) - [Twitter](https://twitter.com/renderATL) - [Instagram](https://www.instagram.com/renderatl/) - [Facebook](https://www.facebook.com/renderatl/) - [LinkedIn](https://www.linkedin.com/company/renderatl)

### ComponentsConf 2020 {#components20}
September 1, 2020 in Melbourne, Australia

Expand Down
8 changes: 1 addition & 7 deletions content/docs/codebase-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@ redirect_from:

これらの規約のいずれかをあなたの React アプリケーションで推奨しているというわけでは必ずしもありません。規約の多くは歴史的な理由で存在しており、時間とともに変化する可能性があります。

### 外部の依存関係 {#external-dependencies}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

節自体消えています


React はほとんど外部の依存関係を持っていません。通常、`require()` は React 自身のコードベースのファイルを指します。ただし、比較的にまれな例外がいくつかあります。

[fbjs リポジトリ](https://github.com/facebook/fbjs)は React がいくつかの小さなユーティリティを [Relay](https://github.com/facebook/relay) のようなライブラリと共有し、それらと同期を保つために存在しています。Facebook のエンジニアが必要に応じて変更を行えるようであってほしいので、Node のエコシステムにある同等の小さなモジュール群には依存しません。fbjs 内にあるユーティリティは全て非公開 API であり、それらは React のような Facebook プロジェクトでのみ使用されるためのものです。

### 最上位フォルダ {#top-level-folders}

[React リポジトリ](https://github.com/facebook/react)をクローンした後、プロジェクトのルートディレクトリに複数のフォルダがあることに気がつくでしょう:
Expand Down Expand Up @@ -171,7 +165,7 @@ React core のコードはソースツリーの [`packages/react`](https://githu

### レンダラ {#renderers}

React は元々 DOM のために作成されましたが、後になって [React Native](http://facebook.github.io/react-native/) によりネイティブなプラットフォームもサポートするようになりました。これにより React の内部に "レンダラ (renderer)" の概念が導入されました。
React は元々 DOM のために作成されましたが、後になって [React Native](https://reactnative.dev/) によりネイティブなプラットフォームもサポートするようになりました。これにより React の内部に "レンダラ (renderer)" の概念が導入されました。

**レンダラは React ツリーを、基盤となるプラットフォーム固有の呼び出しへと変換する方法を管理します。**

Expand Down
9 changes: 4 additions & 5 deletions content/docs/conditional-rendering.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,10 @@ render() {
const isLoggedIn = this.state.isLoggedIn;
return (
<div>
{isLoggedIn ? (
<LogoutButton onClick={this.handleLogoutClick} />
) : (
<LoginButton onClick={this.handleLoginClick} />
)}
{isLoggedIn
? <LogoutButton onClick={this.handleLogoutClick} />
: <LoginButton onClick={this.handleLoginClick} />
}
</div>
);
}
Expand Down
2 changes: 1 addition & 1 deletion content/docs/design-principles.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ UI は動的ですが、props と state の同期的な `render()` 関数によ

### DOM を超えて {#beyond-the-dom}

私たちは React の価値を、バグの少ないコンポーネントを書いてうまく構成することができるという点に見ています。DOM は React のオリジナルのレンダーターゲットですが、[React Native](https://facebook.github.io/react-native/) は Facebook とコミュニティの両方において同じくらい重要です。
私たちは React の価値を、バグの少ないコンポーネントを書いてうまく構成することができるという点に見ています。DOM は React のオリジナルのレンダーターゲットですが、[React Native](https://reactnative.dev/) は Facebook とコミュニティの両方において同じくらい重要です。

レンダラーに依存しないことは React の重要な設計上の制約です。それは内部表現にいくらかのオーバーヘッドを追加します。その一方で、コアへの改善はすべてのプラットフォームに行きわたります。

Expand Down
2 changes: 1 addition & 1 deletion content/docs/handling-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class LoggingButton extends React.Component {
render() {
// This syntax ensures `this` is bound within handleClick
return (
<button onClick={(e) => this.handleClick(e)}>
<button onClick={() => this.handleClick()}>
Click me
</button>
);
Expand Down
6 changes: 3 additions & 3 deletions content/docs/hooks-faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ React バージョン 16.8.0 より、以下においてフックの安定版の

**フックを利用するには、すべての React のパッケージが 16.8.0 以上である必要があります**。例えば React DOM の更新を忘れた場合、フックは動作しません。

React Native は[バージョン 0.59](https://facebook.github.io/react-native/blog/2019/03/12/releasing-react-native-059) 以降でフックをサポートします。
React Native は[バージョン 0.59](https://reactnative.dev/blog/2019/03/12/releasing-react-native-059) 以降でフックをサポートします。

### クラスコンポーネントを全部書き換える必要があるのですか? {#do-i-need-to-rewrite-all-my-class-components}

Expand Down Expand Up @@ -588,7 +588,7 @@ function ProductPage({ productId }) {
const [product, setProduct] = useState(null);

async function fetchProduct() {
const response = await fetch('http://myapi/product' + productId); // Uses productId prop
const response = await fetch('http://myapi/product/' + productId); // Uses productId prop
const json = await response.json();
setProduct(json);
}
Expand All @@ -609,7 +609,7 @@ function ProductPage({ productId }) {
useEffect(() => {
// By moving this function inside the effect, we can clearly see the values it uses.
async function fetchProduct() {
const response = await fetch('http://myapi/product' + productId);
const response = await fetch('http://myapi/product/' + productId);
const json = await response.json();
setProduct(json);
}
Expand Down
2 changes: 1 addition & 1 deletion content/docs/hooks-intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function Example() {

> 補足
>
> React 16.8.0 がフックをサポートする最初のバージョンです。アップグレードの際は、React DOM を含むすべてのパッケージの更新を忘れないようにしてください。React Native は [React Native 0.59 リリース](https://facebook.github.io/react-native/blog/2019/03/12/releasing-react-native-059)以降でフックをサポートします。
> React 16.8.0 がフックをサポートする最初のバージョンです。アップグレードの際は、React DOM を含むすべてのパッケージの更新を忘れないようにしてください。React Native は [React Native 0.59 リリース](https://reactnative.dev/blog/2019/03/12/releasing-react-native-059)以降でフックをサポートします。

## ビデオによる紹介 {#video-introduction}

Expand Down
4 changes: 2 additions & 2 deletions content/docs/hooks-rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ prev: hooks-effect.html

これらの 2 つのルールを強制できる [`eslint-plugin-react-hooks`](https://www.npmjs.com/package/eslint-plugin-react-hooks) という ESLint のプラグインをリリースしました。試したい場合はあなたのプロジェクトに以下のようにして加えることができます。

このプラグインは [Create React App](/docs/create-a-new-react-app.html#create-react-app) ではデフォルトで含まれています。

```bash
npm install eslint-plugin-react-hooks --save-dev
```
Expand All @@ -46,8 +48,6 @@ npm install eslint-plugin-react-hooks --save-dev
}
```

このプラグインは [Create React App](/docs/create-a-new-react-app.html#create-react-app) ではデフォルトで含まれています。

**次のページまで飛ばして[独自のフック](/docs/hooks-custom.html)を書く方法について学んでも構いません。**このページの続きの部分ではこれらのルールの背後にある根拠について述べていきます。

## 解説 {#explanation}
Expand Down
Loading