Skip to content

Commit 2a7607c

Browse files
authored
Merge branch 'master' into sub
2 parents 40306af + e280c48 commit 2a7607c

File tree

126 files changed

+4691
-3278
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+4691
-3278
lines changed

Diff for: .nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
lts/erbium
1+
12.16.1

Diff for: content/blog/2013-10-16-react-v0.5.0.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ It's been awesome to see the things that people are building with React, and we
3434
* Added `React.version`.
3535
* Added `React.isValidClass` - Used to determine if a value is a valid component constructor.
3636
* Removed `React.autoBind` - This was deprecated in v0.4 and now properly removed.
37-
* Renamed `React.unmountAndReleaseReactRootNode` to `React.unmountComponentAtNode`.
37+
* Renamed `React.unmountAndReleaseReactRootNode` to `React.unmountComponentAtNode`.
3838
* Began laying down work for refined performance analysis.
3939
* Better support for server-side rendering - [react-page](https://github.com/facebook/react-page) has helped improve the stability for server-side rendering.
4040
* Made it possible to use React in environments enforcing a strict [Content Security Policy](https://developer.mozilla.org/en-US/docs/Security/CSP/Introducing_Content_Security_Policy). This also makes it possible to use React to build Chrome extensions.

Diff for: content/blog/2016-07-13-mixins-considered-harmful.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ var Button = React.createClass({
607607

608608
Sometimes people use mixins to selectively add logging to lifecycle methods in some components. In the future, we intend to provide an [official DevTools API](https://github.com/facebook/react/issues/5306) that would let you implement something similar without touching the components. However it’s still very much a work in progress. If you heavily depend on logging mixins for debugging, you might want to keep using those mixins for a little longer.
609609

610-
If you can’t accomplish something with a component, a higher-order component, or a utility module, it could be mean that React should provide this out of the box. [File an issue](https://github.com/facebook/react/issues/new) to tell us about your use case for mixins, and we’ll help you consider alternatives or perhaps implement your feature request.
610+
If you can’t accomplish something with a component, a higher-order component, or a utility module, it could mean that React should provide this out of the box. [File an issue](https://github.com/facebook/react/issues/new) to tell us about your use case for mixins, and we’ll help you consider alternatives or perhaps implement your feature request.
611611

612612
Mixins are not deprecated in the traditional sense. You can keep using them with `React.createClass()`, as we won’t be changing it further. Eventually, as ES6 classes gain more adoption and their usability problems in React are solved, we might split `React.createClass()` into a separate package because most people wouldn’t need it. Even in that case, your old mixins would keep working.
613613

Diff for: content/blog/2019-08-15-new-react-devtools.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ It also offers full support for React Hooks, including inspecting nested objects
2323
* `16.x`: Supported
2424

2525
**`react-native`**
26-
* `0`-`0.61`: Not supported
27-
* `0.62`: Will be supported (when 0.62 is released)
26+
* `0`-`0.61.x`: Not supported
27+
* `0.62`: Supported
2828

2929
## How do I get the new DevTools? {#how-do-i-get-the-new-devtools}
3030

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,6 @@ Refer to the documentation for [detailed installation instructions](/docs/instal
204204
- Adjust `SuspenseList` CPU bound heuristic ([@sebmarkbage](https://github.com/sebmarkbage) in [#17455](https://github.com/facebook/react/pull/17455))
205205
- Add missing event plugin priorities ([@trueadm](https://github.com/trueadm) in [#17914](https://github.com/facebook/react/pull/17914))
206206
- Fix `isPending` only being true when transitioning from inside an input event ([@acdlite](https://github.com/acdlite) in [#17382](https://github.com/facebook/react/pull/17382))
207-
- Fix `React.memo` components dropping updates when interrupted by a higher priority update ([@acdlite](<(https://github.com/acdlite)>) in [#18091](https://github.com/facebook/react/pull/18091))
207+
- Fix `React.memo` components dropping updates when interrupted by a higher priority update ([@acdlite](https://github.com/acdlite) in [#18091](https://github.com/facebook/react/pull/18091))
208208
- Don't warn when suspending at the wrong priority ([@gaearon](https://github.com/gaearon) in [#17971](https://github.com/facebook/react/pull/17971))
209209
- Fix a bug with rebasing updates ([@acdlite](https://github.com/acdlite) and [@sebmarkbage](https://github.com/sebmarkbage) in [#17560](https://github.com/facebook/react/pull/17560), [#17510](https://github.com/facebook/react/pull/17510), [#17483](https://github.com/facebook/react/pull/17483), [#17480](https://github.com/facebook/react/pull/17480))

Diff for: content/community/courses.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ permalink: community/courses.html
1818

1919
- [React Armory: Learn React by Itself](https://reactarmory.com/guides/learn-react-by-itself) - With React Armory, you can learn React without the buzzwords.
2020

21-
- [The Road to Learn React](https://www.robinwieruch.de/the-road-to-learn-react/) - Build a real world application in plain React without complicated tooling.
22-
2321
- [Egghead.io: The Beginner's Guide to ReactJS](https://egghead.io/courses/the-beginner-s-guide-to-reactjs) - Free course for React newbies and those looking to get a better understanding of React fundamentals.
2422

2523
- [Free React Bootcamp](https://tylermcginnis.com/free-react-bootcamp/) - Recordings from three days of a free online React bootcamp.
@@ -49,3 +47,5 @@ permalink: community/courses.html
4947
- [Tyler McGinnis](https://tylermcginnis.com/courses) - Tyler McGinnis provides access to his courses for a monthly fee. Courses include "React Fundamentals" and "Universal React".
5048

5149
- [Mastering React](https://codewithmosh.com/p/mastering-react/) - Build professional interactive apps with React.
50+
51+
- [Road to React](https://www.roadtoreact.com/) - Your journey to master React in JavaScript.

Diff for: content/community/examples.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ There are many example projects created by the React community. We're keeping th
1010

1111
If you add a project, please commit to keeping it up to date with the latest versions of React.
1212

13-
## Small Examples
13+
## Small Examples {#small-examples}
1414

1515
* **[Calculator](https://github.com/ahfarmer/calculator)** Implementation of the iOS calculator built in React
1616
* **[Emoji Search](https://github.com/ahfarmer/emoji-search)** React app for searching emoji
@@ -20,7 +20,6 @@ If you add a project, please commit to keeping it up to date with the latest ver
2020
* **[Counter App](https://github.com/arnab-datta/counter-app)** A small shopping cart example
2121
* **[Tutorial Solutions](https://github.com/harman052/react-tutorial-solutions)** Solutions to challenges mentioned at the end of React tutorial
2222

23-
## Complete Apps
23+
## Complete Apps {#complete-apps}
2424

25-
* **[Hacker News Clone React/GraphQL](https://github.com/clintonwoo/hackernews-react-graphql)** Hacker News clone rewritten with universal JavaScript, using React and GraphQL
2625
* **[Builder Book](https://github.com/builderbook/builderbook)** Open-source web app to write and host documentation or sell books. Built with React, Material-UI, Next, Express, Mongoose, MongoDB

Diff for: content/community/meetups.md

+1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ Do you have a local React.js meetup? Add it here! (Please keep the list alphabet
8080

8181
## India {#india}
8282
* [Bangalore](https://www.meetup.com/ReactJS-Bangalore/)
83+
* [Bangalore](https://www.meetup.com/React-Native-Bangalore-Meetup)
8384
* [Chandigarh](https://www.meetup.com/Chandigarh-React-Developers/)
8485
* [Chennai](https://www.meetup.com/React-Chennai/)
8586
* [Delhi NCR](https://www.meetup.com/React-Delhi-NCR/)

Diff for: content/community/team.md

+13-13
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,6 @@ Brian studied art in college and did programming on the side to pay for his educ
3838

3939
Dan got into programming after he accidentally discovered Visual Basic inside Microsoft PowerPoint. He has found his true calling in turning [Sebastian](#sebastian-markbage)'s tweets into long-form blog posts. Dan occasionally wins at Fortnite by hiding in a bush until the game ends.
4040

41-
### Dominic Gannaway {#dominic-gannaway}
42-
43-
![Dominic](../images/team/trueadm.jpg)
44-
45-
[@trueadm on GitHub](https://github.com/trueadm) &middot; [@trueadm on Twitter](https://twitter.com/trueadm)
46-
47-
Dominic is interested in travelling, drum and bass, stand-up comedy and spending time with the family. He most enjoys hacking on new unexplored ideas around UIs and accessibility and has a passion for tweaking and optimizing code to get the most performance out of things.
48-
4941
### Luna Ruan {#luna-ruan}
5042

5143
![Luna](../images/team/lunaruan.jpg)
@@ -62,6 +54,14 @@ Luna learned programming because she thought it meant creating video games. Inst
6254

6355
Rachel wrote a [book about UI animation](https://abookapart.com/products/animation-at-work) once and worked with MDN and the W3C on the web animations API. Now she is busy with education materials and community engineering on the React team. Secretly, she is an award-winning cartoonist for teenage girls. Catch her making fancy tea with lukewarm water in the microkitchen.
6456

57+
### Rick Hanlon {#rick-hanlon}
58+
59+
![Ricky](../images/team/rickhanlonii.jpg)
60+
61+
[@rickhanlonii on GitHub](https://github.com/rickhanlonii) &middot; [@rickhanlonii on Twitter](https://twitter.com/rickhanlonii)
62+
63+
Ricky majored in theoretical math and somehow found himself on the React Native team for a couple years before joining the React team. When he's not programming you can find him snowboarding, biking, climbing, golfing, or closing GitHub issues that do not match the issue template.
64+
6565
### Sebastian Markbåge {#sebastian-markbage}
6666

6767
![Sebastian](../images/team/sebmarkbage.jpg)
@@ -70,13 +70,11 @@ Rachel wrote a [book about UI animation](https://abookapart.com/products/animati
7070

7171
Sebastian majored in psychology. He's usually quiet. Even when he says something, it often doesn't make sense to the rest of us until a few months later. The correct way to pronounce his surname is "mark-boa-geh" but he settled for "mark-beige" out of pragmatism -- and that's how he approaches React.
7272

73-
### Yuzhi Zheng {#yuzhi-zheng}
74-
75-
![Yuzhi](../images/team/yuzhi.jpg)
73+
### Seth Webster {#seth-webster}
7674

77-
[@yuzhi on GitHub](https://github.com/yuzhi) &middot; [@yuzhiz on Twitter](https://twitter.com/yuzhiz)
75+
![Seth](../images/team/sethwebster.jpg)
7876

79-
Yuzhi studied Computer Science in school. She liked the instant gratification of seeing code come to life without having to physically be in a laboratory. Now she manages the React team. Before management, she used to work on the Relay data fetching framework. In her spare time, Yuzhi enjoys optimizing her life via gardening and home improvement projects.
77+
Seth started programming as a kid growing up in Tucson, AZ. After school, he was bitten by the music bug and was a touring musician for about 10 years before returning to *work*, starting with Intuit. In his spare time, he loves [taking pictures](https://www.sethwebster.com) and flying for animal rescues in the northeastern United States.
8078

8179
## Acknowledgements {#acknowledgements}
8280

@@ -93,6 +91,7 @@ React was originally created by [Jordan Walke](https://github.com/jordwalke). To
9391
* [Christoph Nakazawa](https://github.com/cpojer)
9492
* [Christopher Chedeau](https://github.com/vjeux)
9593
* [Clement Hoang](https://github.com/clemmy)
94+
* [Dominic Gannaway](https://github.com/trueadm)
9695
* [Flarnie Marchan](https://github.com/flarnie)
9796
* [Jason Quense](https://github.com/jquense)
9897
* [Jesse Beach](https://github.com/jessebeach)
@@ -114,6 +113,7 @@ React was originally created by [Jordan Walke](https://github.com/jordwalke). To
114113
* [Sophie Alpert](https://github.com/sophiebits)
115114
* [Sunil Pai](https://github.com/threepointone)
116115
* [Tim Yung](https://github.com/yungsters)
116+
* [Yuzhi Zheng](https://github.com/yuzhi)
117117

118118
This list is not exhaustive.
119119

Diff for: content/docs/code-splitting.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ console.log(add(16, 26)); // 42
4040
>
4141
> 실제 번들은 위 예시와는 많이 다르게 보일 겁니다.
4242
43-
[Create React App](https://github.com/facebookincubator/create-react-app)이나 [Next.js](https://github.com/zeit/next.js/), [Gatsby](https://www.gatsbyjs.org/) 혹은 비슷한 툴을 사용한다면 여러분이 설치한 앱에서 Webpack을 같이 설치했을 겁니다.
43+
[Create React App](https://create-react-app.dev/)이나 [Next.js](https://nextjs.org/), [Gatsby](https://www.gatsbyjs.org/) 혹은 비슷한 툴을 사용한다면 여러분이 설치한 앱에서 Webpack을 같이 설치했을 겁니다.
4444

4545
이런 툴을 사용하지 않는다면 여러분이 스스로 번들링을 설정해야 합니다. 이 경우 Webpack의
4646
[설치하기](https://webpack.js.org/guides/installation/) 문서와

Diff for: content/docs/codebase-overview.md

+5-60
Original file line numberDiff line numberDiff line change
@@ -35,33 +35,11 @@ React 앱을 개발하는데 있어서 아래 관례들의 사용을 반드시
3535

3636
### 경고와 불변식 {#warnings-and-invariants}
3737

38-
React 코드베이스는 경고를 표시하기 위해 다음과 같이 `warning` 모듈을 사용합니다.
38+
React 코드베이스에서는 `console.error`를 사용해 경고를 표시합니다.
3939

4040
```js
41-
var warning = require('warning');
42-
43-
warning(
44-
2 + 2 === 4,
45-
'Math is not working today.'
46-
);
47-
```
48-
49-
**경고는 `warning`의 대상 조건식이 `false`일 때 표시됩니다.**
50-
51-
해당 옵션은 예외적인 경우보다 일반적인 상황을 반영해야 합니다.
52-
53-
다음과 같은 코드를 통해 중복되는 경고로 콘솔이 불필요하게 복잡해지는 상황을 피할 수 있습니다.
54-
55-
```js
56-
var warning = require('warning');
57-
58-
var didWarnAboutMath = false;
59-
if (!didWarnAboutMath) {
60-
warning(
61-
2 + 2 === 4,
62-
'Math is not working today.'
63-
);
64-
didWarnAboutMath = true;
41+
if (__DEV__) {
42+
console.error('Something is wrong.');
6543
}
6644
```
6745

@@ -114,39 +92,6 @@ ReactRef.detachRefs = function(
11492
가능하면 새로 작성하는 코드에 Flow 검사 형식을 포함해 주길 바랍니다.
11593
`yarn flow` 명령어를 통해 Flow에 대한 형식 검사를 직접 수행해 볼 수 있습니다.
11694

117-
### 동적 주입 {#dynamic-injection}
118-
119-
React의 몇 가지 모듈은 동적 주입을 사용합니다. 동적 주입은 항상 명시적이지만 코드에 대한 이해를 방해하기도 합니다. 동적 주입을 사용하는 주된 이유는 React가 DOM을 대상으로만 지원했기 때문입니다. React 네이티브는 React 프로젝트에서 시작되었기 때문에 몇 가지 동작을 구현하기 위해 동적 주입을 필요로 했습니다.
120-
121-
다음과 같은 동적 의존성을 가진 모듈을 확인할 수 있습니다.
122-
123-
```js
124-
// Dynamically injected
125-
var textComponentClass = null;
126-
127-
// Relies on dynamically injected value
128-
function createInstanceForText(text) {
129-
return new textComponentClass(text);
130-
}
131-
132-
var ReactHostComponent = {
133-
createInstanceForText,
134-
135-
// Provides an opportunity for dynamic injection
136-
injection: {
137-
injectTextComponentClass: function(componentClass) {
138-
textComponentClass = componentClass;
139-
},
140-
},
141-
};
142-
143-
module.exports = ReactHostComponent;
144-
```
145-
146-
`injection` 필드는 특별하게 관리되지 않습니다. 다만 관례적으로 해당 필드는 런타임 시에 (플랫폼 관련 요소와 같은) 몇 가지 종속성을 주입하고자 할 때 사용됩니다.
147-
148-
React 코드베이스에는 다수의 동적 주입 부분이 존재합니다. React는 향후 동적 주입에 관련된 매커니즘을 제거하고, 빌드 시에 정적으로 병합하는 방식을 사용할 것입니다.
149-
15095
### 다양한 패키지 {#multiple-packages}
15196

15297
React는 [monorepo](https://danluu.com/monorepo/)입니다. 해당 저장소는 여러 분리된 패키지를 포함하고 있으며, 각 변경점들은 함께 반영되고 모든 이슈는 한 곳에서 관리됩니다.
@@ -183,7 +128,7 @@ React는 원래 DOM을 대상으로 하여 개발됐지만, 이후 [React 네이
183128
184129
### 재조정자 {#reconcilers}
185130

186-
React DOM과 React 네이티브 같은 매우 다른 경우를 포함하여, 렌더러들은 상당 부분 동작 방식을 서로 공유해야 합니다. 특히 [재조정](/docs/reconciliation.html) 알고리즘의 경우는 더욱 그렇습니다. 이를 통해 렌더링, 사용자 정의 컴포넌트, 상태, 생명주기 메소드, 레퍼런스가 플랫폼에 상관없이 일관적으로 작동해야 합니다.
131+
React DOM과 React 네이티브 같은 매우 다른 경우를 포함하여, 렌더러들은 상당 부분 동작 방식을 서로 공유해야 합니다. 특히 [재조정](/docs/reconciliation.html) 알고리즘의 경우는 더욱 그렇습니다. 이를 통해 렌더링, 사용자 정의 컴포넌트, 상태, 생명주기 메서드, 레퍼런스가 플랫폼에 상관없이 일관적으로 작동해야 합니다.
187132

188133
이를 해결하기 위해 서로 다른 렌더러들은 몇 가지의 코드를 공유하며, 해당 부분을 '재조정자'라고 부릅니다. `setState()`와 같은 함수가 수정되어야 할 때, 재조정자는 트리에 있는 컴포넌트의 `render()` 함수를 호출한 후 마운트나 업데이트, 혹은 마운트해제를 실시합니다.
189134

@@ -211,7 +156,7 @@ React 파이버 구조에 대해 [여기](https://github.com/acdlite/react-fiber
211156

212157
### 이벤트 시스템 {#event-system}
213158

214-
React는 렌더러와 무관하며 React DOM 및 React Native와 함께 작동하는 합성 이벤트 시스템을 구현합니다. 해당 코드는 [`packages/legacy-events`](https://github.com/facebook/react/tree/master/packages/legacy-events)에서 확인할 수 있습니다.
159+
React는 네이티브 이벤트 위에 레이어를 구현하여 크로스 브라우저 차이를 제거했습니다. 해당 코드는 [`packages/react-dom/src/events`](https://github.com/facebook/react/tree/master/packages/react-dom/src/events)에서 확인할 수 있습니다.
215160

216161
해당 코드에 대한 상세한 설명은 다음의 [영상](https://www.youtube.com/watch?v=dRo_egw7tBc) (66분)을 참고하세요.
217162

Diff for: content/docs/components-and-props.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ function Comment(props) {
237237

238238
[CodePen에서 시험해보기](codepen://components-and-props/extracting-components-continued)
239239

240-
처음에는 컴포넌트를 추출하는 작업이 지루해 보일 수 있습니다. 하지만 재사용 가능한 컴포넌트를 만들어 놓는 것은 더 큰 앱에서 작업할 때 두각을 나타냅니다. UI 일부가 여러 번 사용되거나 (`Button`, `Panel`, `Avatar`), UI 일부가 자체적으로 복잡한 (`App`, `FeedStory`, `Comment`) 경우에는 재사용 가능한 컴포넌트로 만드는 것이 좋습니다.
240+
처음에는 컴포넌트를 추출하는 작업이 지루해 보일 수 있습니다. 하지만 재사용 가능한 컴포넌트를 만들어 놓는 것은 더 큰 앱에서 작업할 때 두각을 나타냅니다. UI 일부가 여러 번 사용되거나 (`Button`, `Panel`, `Avatar`), UI 일부가 자체적으로 복잡한 (`App`, `FeedStory`, `Comment`) 경우에는 별도의 컴포넌트로 만드는 좋습니다.
241241

242242
## props는 읽기 전용입니다. {#props-are-read-only}
243243

0 commit comments

Comments
 (0)