Skip to content

Sync with reactjs.org @ 2ef0ee1e #199

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 31 commits into from
Mar 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 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
2a959fe
merging all conflicts
reactjs-translation-bot Mar 16, 2020
4f5dcbb
Update handling-events.md
alioguzhan Mar 23, 2020
4b56de0
Update hooks-intro.md
alioguzhan Mar 23, 2020
fce46ff
Update MarkdownPage.js
alioguzhan Mar 23, 2020
9405d8e
Update motivation-solution.js
alioguzhan Mar 23, 2020
5382816
Update learn-once-write-anywhere.md
alioguzhan Mar 23, 2020
e1e1228
Update refs-and-the-dom.md
alioguzhan Mar 23, 2020
90275ed
Update reference-react.md
alioguzhan Mar 23, 2020
3766f79
Update hooks-rules.md
alioguzhan Mar 23, 2020
d9d4c3f
Update hooks-rules.md
alioguzhan Mar 23, 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
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 @@ If you want to [contribute to React](/docs/how-to-contribute.html) we hope that

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

### External Dependencies {#external-dependencies}

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.

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.

### Top-Level Folders {#top-level-folders}

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

### Renderers {#renderers}

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

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

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 @@ -174,11 +174,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 @@ We do, however, provide some global configuration on the build level. For exampl

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

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

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.

Expand Down
4 changes: 2 additions & 2 deletions content/docs/handling-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ redirect_from:
- "docs/events-ko-KR.html"
---

React'teki olay yönetimi, DOM elementlerindeki olay yönetimi ile oldukça benzerdir. Sadece, bazı küçük farklılıklar bulunmaktadır:
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:

* Olay isimleri, DOM'da lowercase iken, React'te camelCase olarak adlandırılır.
* DOM'da fonksiyon isimleri, ilgili olaya string olarak atanırken, JSX'te direkt fonksiyon olarak atanır.
Expand Down Expand Up @@ -130,7 +130,7 @@ class LoggingButton extends React.Component {
render() {
// Bu yazım şekli, `this`'in handleClick içerisinde bağlanmasını sağlar.
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 @@ Starting with 16.8.0, React includes a stable implementation of React Hooks for:

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.

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

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

Expand Down Expand Up @@ -589,7 +589,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 @@ -610,7 +610,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
3 changes: 2 additions & 1 deletion content/docs/hooks-intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ Bu yeni `useState` fonksiyonu öğreneceğimiz ilk "Hook", ancak bu örnek sadec

>Not
>
>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.
>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://reactnative.dev/blog/2019/03/12/releasing-react-native-059) desteklemektedir.

## Tanıtım Videosu {#video-introduction}

Expand Down
2 changes: 1 addition & 1 deletion content/docs/hooks-rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ npm install eslint-plugin-react-hooks --save-dev

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

**[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.
**[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.

## Açıklama {#explanation}

Expand Down
16 changes: 12 additions & 4 deletions content/docs/how-to-contribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,19 +130,27 @@ First, run `yarn build`. This will produce pre-built bundles in `build` folder,

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.

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:
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. Note that **instead of `--type=UMD` you'll want to pass `--type=NODE` when building**. You'll also need to build the `scheduler` package:

```sh
cd ~/path_to_your_react_clone/build/node_modules/react
cd ~/path_to_your_react_clone/
yarn build react/index,react-dom/index,scheduler --type=NODE

cd build/node_modules/react
yarn link
cd ~/path_to_your_react_clone/build/node_modules/react-dom
cd build/node_modules/react-dom
yarn link
cd /path/to/your/project

cd ~/path/to/your/project
yarn link react react-dom
```

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.

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.

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.

### Style Guide {#style-guide}
Expand Down
2 changes: 1 addition & 1 deletion content/docs/jsx-in-depth.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ If you pass no value for a prop, it defaults to `true`. These two JSX expression
<MyTextBox autocomplete={true} />
```

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

### Spread Attributes {#spread-attributes}

Expand Down
Loading