Skip to content

Commit 6a45b84

Browse files
authored
Merge pull request #199 from reactjs/sync-2ef0ee1e
Sync with reactjs.org @ 2ef0ee1
2 parents 22f61bf + d9d4c3f commit 6a45b84

36 files changed

+6866
-5915
lines changed

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ version: 2
22
jobs:
33
build:
44
docker:
5-
- image: circleci/node:8
5+
- image: circleci/node:12
66
steps:
77
- checkout
88
- restore_cache:
99
keys:
10-
- dependencies-{{ checksum "yarn.lock" }}
10+
- dependencies-{{ checksum "yarn.lock" }}
1111
- run:
1212
name: Install
1313
command: yarn install --pure-lockfile

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
lts/carbon
1+
lts/erbium

content/blog/2013-06-19-community-roundup-2.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Since the launch we have received a lot of feedback and are actively working on
99

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

12-
> 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.
12+
> 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.
1313
>
1414
> 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.
1515
>

content/blog/2015-03-26-introducing-react-native.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ For more details, see [Tom Occhino's post on the Facebook Engineering blog](http
1313
>
1414
> *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.”*
1515
16-
To learn more, visit the [React Native website](https://facebook.github.io/react-native/).
16+
To learn more, visit the [React Native website](https://reactnative.dev/).

content/blog/2015-05-01-graphql-introduction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: "GraphQL Introduction"
33
author: [schrockn]
44
---
55

6-
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).
6+
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).
77

88
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.
99

content/blog/2018-06-07-you-probably-dont-need-derived-state.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Problems arise when any of these constraints are changed. This typically comes i
4040

4141
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.**
4242

43-
Let’s consider an example to demonstrate the problem. Here is a `EmailInput` component that "mirrors" an email prop in state:
43+
Let’s consider an example to demonstrate the problem. Here is an `EmailInput` component that "mirrors" an email prop in state:
4444
```js
4545
class EmailInput extends Component {
4646
state = { email: this.props.email };

content/blog/2018-11-13-react-conf-recap.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ On the morning of Day 2, Andrew Clark and Brian Vaughn presented Concurrent Rend
2121

2222
<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>
2323

24-
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.
24+
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.
2525

2626
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!

content/blog/2019-02-23-is-react-translated-yet.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Creating the [sync script](https://github.com/reactjs/reactjs.org-translation/bl
5555

5656
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!
5757

58-
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.
58+
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.
5959

6060
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.
6161

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ These estimates were too optimistic, and we've needed to adjust them.
149149

150150
**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.
151151

152-
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.
152+
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.
153153

154154
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.
155155

content/blog/2020-02-26-react-v16.13.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Warning: Cannot update a component from inside the function body of a different
2121

2222
**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`.
2323

24-
### Warnings for conflicting style rules
24+
### Warnings for conflicting style rules {#warnings-for-conflicting-style-rules}
2525

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

content/community/conferences.md

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ 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-
### ReactConf Japan 2020 {#reactconfjp-2020}
16-
March 21, 2020 in Tokyo, Japan
17-
18-
[Website](https://reactconf.jp/) - [Twitter](https://twitter.com/reactjp)
19-
2015
### Reactathon 2020 {#reactathon-2020}
2116
March 30 - 31, 2020 in San Francisco, CA
2217

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

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

45-
### render(ATL) 2020 {#render-atlanta-2020}
46-
May 4-6, 2020. Atlanta, GA, USA.
47-
48-
[Website](https://renderatl.com) - [Twitter](https://twitter.com/renderATL) - [Instagram](https://www.instagram.com/renderatl/) - [Facebook](https://www.facebook.com/renderatl/)
49-
5040
### ReactEurope 2020 {#reacteurope-2020}
5141
May 14-15, 2020 in Paris, France
5242

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

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

75+
### render(ATL) 2020 {#render-atlanta-2020}
76+
August 24-26, 2020. Atlanta, GA, USA.
77+
78+
[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)
79+
8580
### ComponentsConf 2020 {#components20}
8681
September 1, 2020 in Melbourne, Australia
8782

content/docs/codebase-overview.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,6 @@ If you want to [contribute to React](/docs/how-to-contribute.html) we hope that
1515

1616
We don't necessarily recommend any of these conventions in React apps. Many of them exist for historical reasons and might change with time.
1717

18-
### External Dependencies {#external-dependencies}
19-
20-
React has almost no external dependencies. Usually, a `require()` points to a file in React's own codebase. However, there are a few relatively rare exceptions.
21-
22-
The [fbjs repository](https://github.com/facebook/fbjs) exists because React shares some small utilities with libraries like [Relay](https://github.com/facebook/relay), and we keep them in sync. We don't depend on equivalent small modules in the Node ecosystem because we want Facebook engineers to be able to make changes to them whenever necessary. None of the utilities inside fbjs are considered to be public API, and they are only intended for use by Facebook projects such as React.
23-
2418
### Top-Level Folders {#top-level-folders}
2519

2620
After cloning the [React repository](https://github.com/facebook/react), you will see a few top-level folders in it:
@@ -171,7 +165,7 @@ The code for React core is located in [`packages/react`](https://github.com/face
171165

172166
### Renderers {#renderers}
173167

174-
React was originally created for the DOM but it was later adapted to also support native platforms with [React Native](https://facebook.github.io/react-native/). This introduced the concept of "renderers" to React internals.
168+
React was originally created for the DOM but it was later adapted to also support native platforms with [React Native](https://reactnative.dev/). This introduced the concept of "renderers" to React internals.
175169

176170
**Renderers manage how a React tree turns into the underlying platform calls.**
177171

content/docs/conditional-rendering.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,11 +174,10 @@ render() {
174174
const isLoggedIn = this.state.isLoggedIn;
175175
return (
176176
<div>
177-
{isLoggedIn ? (
178-
<LogoutButton onClick={this.handleLogoutClick} />
179-
) : (
180-
<LoginButton onClick={this.handleLoginClick} />
181-
)}
177+
{isLoggedIn
178+
? <LogoutButton onClick={this.handleLogoutClick} />
179+
: <LoginButton onClick={this.handleLoginClick} />
180+
}
182181
</div>
183182
);
184183
}

content/docs/design-principles.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ We do, however, provide some global configuration on the build level. For exampl
126126

127127
### Beyond the DOM {#beyond-the-dom}
128128

129-
We see the value of React in the way it allows us to write components that have fewer bugs and compose together well. DOM is the original rendering target for React but [React Native](https://facebook.github.io/react-native/) is just as important both to Facebook and the community.
129+
We see the value of React in the way it allows us to write components that have fewer bugs and compose together well. DOM is the original rendering target for React but [React Native](https://reactnative.dev/) is just as important both to Facebook and the community.
130130

131131
Being renderer-agnostic is an important design constraint of React. It adds some overhead in the internal representations. On the other hand, any improvements to the core translate across platforms.
132132

content/docs/handling-events.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ redirect_from:
88
- "docs/events-ko-KR.html"
99
---
1010

11-
React'teki olay yönetimi, DOM elementlerindeki olay yönetimi ile oldukça benzerdir. Sadece, bazı küçük farklılıklar bulunmaktadır:
11+
React'teki olay yönetimi, DOM elementlerindeki olay yönetimi ile oldukça benzerdir. Sadece, bazı küçük sözdizimi farklılıkları bulunmaktadır:
1212

1313
* Olay isimleri, DOM'da lowercase iken, React'te camelCase olarak adlandırılır.
1414
* DOM'da fonksiyon isimleri, ilgili olaya string olarak atanırken, JSX'te direkt fonksiyon olarak atanır.
@@ -130,7 +130,7 @@ class LoggingButton extends React.Component {
130130
render() {
131131
// Bu yazım şekli, `this`'in handleClick içerisinde bağlanmasını sağlar.
132132
return (
133-
<button onClick={(e) => this.handleClick(e)}>
133+
<button onClick={() => this.handleClick()}>
134134
Click me
135135
</button>
136136
);

content/docs/hooks-faq.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Starting with 16.8.0, React includes a stable implementation of React Hooks for:
7171

7272
Note that **to enable Hooks, all React packages need to be 16.8.0 or higher**. Hooks won't work if you forget to update, for example, React DOM.
7373

74-
[React Native 0.59](https://facebook.github.io/react-native/blog/2019/03/12/releasing-react-native-059) and above support Hooks.
74+
[React Native 0.59](https://reactnative.dev/blog/2019/03/12/releasing-react-native-059) and above support Hooks.
7575

7676
### Do I need to rewrite all my class components? {#do-i-need-to-rewrite-all-my-class-components}
7777

@@ -589,7 +589,7 @@ function ProductPage({ productId }) {
589589
const [product, setProduct] = useState(null);
590590
591591
async function fetchProduct() {
592-
const response = await fetch('http://myapi/product' + productId); // Uses productId prop
592+
const response = await fetch('http://myapi/product/' + productId); // Uses productId prop
593593
const json = await response.json();
594594
setProduct(json);
595595
}
@@ -610,7 +610,7 @@ function ProductPage({ productId }) {
610610
useEffect(() => {
611611
// By moving this function inside the effect, we can clearly see the values it uses.
612612
async function fetchProduct() {
613-
const response = await fetch('http://myapi/product' + productId);
613+
const response = await fetch('http://myapi/product/' + productId);
614614
const json = await response.json();
615615
setProduct(json);
616616
}

content/docs/hooks-intro.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ Bu yeni `useState` fonksiyonu öğreneceğimiz ilk "Hook", ancak bu örnek sadec
3131

3232
>Not
3333
>
34-
>React 16.8.0, Hook'ları destekleyen ilk sürümdür. Sürüm yükseltme yaparken, React DOM dahil olmak üzere tüm paketleri güncellemeyi unutmayın. React Native, Hook'ları [0.59 sürümünden itibaren](https://facebook.github.io/react-native/blog/2019/03/12/releasing-react-native-059) desteklemektedir.
34+
>React 16.8.0, Hook'ları destekleyen ilk sürümdür. Sürüm yükseltme yaparken, React DOM dahil olmak üzere tüm paketleri güncellemeyi unutmayın.
35+
>React Native, Hook'ları [0.59 sürümünden itibaren](https://reactnative.dev/blog/2019/03/12/releasing-react-native-059) desteklemektedir.
3536
3637
## Tanıtım Videosu {#video-introduction}
3738

content/docs/hooks-rules.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ npm install eslint-plugin-react-hooks --save-dev
4848

4949
Bu eklenti varsayılan olarak [Create React App](/docs/create-a-new-react-app.html#create-react-app) aracına dahil edilmiştir.
5050

51-
**[Kendi Hook'larınızı](/docs/hooks-custom.html) nasıl yazacağınızı açıklayan bir sonraki sayfaya şimdi atlayabilirsiniz.** Bu sayfada, bu kuralların ardındaki mantığı açıklayarak devam edeceğiz.
51+
**[Kendi Hook'larınızı](/docs/hooks-custom.html) nasıl yazacağınızı açıklayan bir sonraki sayfaya şimdi atlayabilirsiniz.** Bu sayfaya, bu kuralların ardındaki mantığı açıklayarak devam edeceğiz.
5252

5353
## Açıklama {#explanation}
5454

content/docs/how-to-contribute.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,19 +130,27 @@ First, run `yarn build`. This will produce pre-built bundles in `build` folder,
130130

131131
The easiest way to try your changes is to run `yarn build react/index,react-dom/index --type=UMD` and then open `fixtures/packaging/babel-standalone/dev.html`. This file already uses `react.development.js` from the `build` folder so it will pick up your changes.
132132

133-
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 `yarn link` to point them to your local `build` folder:
133+
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.
134+
135+
If your project uses React from npm, you may delete `react` and `react-dom` in its dependencies and use `yarn link` to point them to your local `build` folder. Note that **instead of `--type=UMD` you'll want to pass `--type=NODE` when building**. You'll also need to build the `scheduler` package:
134136

135137
```sh
136-
cd ~/path_to_your_react_clone/build/node_modules/react
138+
cd ~/path_to_your_react_clone/
139+
yarn build react/index,react-dom/index,scheduler --type=NODE
140+
141+
cd build/node_modules/react
137142
yarn link
138-
cd ~/path_to_your_react_clone/build/node_modules/react-dom
143+
cd build/node_modules/react-dom
139144
yarn link
140-
cd /path/to/your/project
145+
146+
cd ~/path/to/your/project
141147
yarn link react react-dom
142148
```
143149

144150
Every time you run `yarn build` in the React folder, the updated versions will appear in your project's `node_modules`. You can then rebuild your project to try your changes.
145151

152+
If some package is still missing (e.g. maybe you use `react-dom/server` in your project), you can always do a full build with `yarn build`. Note that running `yarn build` without options takes a long time.
153+
146154
We still require that your pull request contains unit tests for any new functionality. This way we can ensure that we don't break your code in the future.
147155

148156
### Style Guide {#style-guide}

content/docs/jsx-in-depth.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ If you pass no value for a prop, it defaults to `true`. These two JSX expression
227227
<MyTextBox autocomplete={true} />
228228
```
229229

230-
In general, we don't recommend using this because it can be confused with the [ES6 object shorthand](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Operators/Object_initializer#New_notations_in_ECMAScript_2015) `{foo}` which is short for `{foo: foo}` rather than `{foo: true}`. This behavior is just there so that it matches the behavior of HTML.
230+
In general, we don't recommend *not* passing a value for a prop, because it can be confused with the [ES6 object shorthand](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Operators/Object_initializer#New_notations_in_ECMAScript_2015) `{foo}` which is short for `{foo: foo}` rather than `{foo: true}`. This behavior is just there so that it matches the behavior of HTML.
231231

232232
### Spread Attributes {#spread-attributes}
233233

0 commit comments

Comments
 (0)