Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion content/docs/forms.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ HTML에서 `<input>`, `<textarea>`, `<select>`와 같은 폼 엘리먼트는 일

예를 들어, 이전 예시가 전송될 때 이름을 기록하길 원한다면 폼을 제어 컴포넌트 (controlled component)로 작성할 수 있습니다.

```javascript{4,10-12,24}
```javascript{4,10-12,21,24}
class NameForm extends React.Component {
constructor(props) {
super(props);
Expand Down
26 changes: 26 additions & 0 deletions content/docs/how-to-contribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ Public API를 변경하거나 구현을 간단하게 변경하려 할 때 [이

**풀 리퀘스트를 보내기 전에,** 다음 사항을 확인해 주세요.

<<<<<<< HEAD
1. [저장소](https://github.com/facebook/react)를 포크하고 `master`로부터 새로운 브랜치를 생성합니다.
2. 저장소 루트에서 `yarn` 명령을 실행합니다.
3. 버그를 수정했거나 테스트가 필요한 코드를 추가했다면 테스트를 추가해 주세요.
Expand All @@ -94,6 +95,18 @@ Public API를 변경하거나 구현을 간단하게 변경하려 할 때 [이
8. 코드를 린트하세요 (`yarn lint`). Tip: `yarn linc` 는 변경된 파일만 확인할 수 있습니다.
9. [Flow](https://flowtype.org/) 타입 검사를 실행하세요. (`yarn flow`).
10. 아직 CLA에 서명하지 않았다면, 서명을 완료해주세요.
=======
1. Fork [the repository](https://github.com/facebook/react) and create your branch from `master`.
2. Run `yarn` in the repository root.
3. If you've fixed a bug or added code that should be tested, add tests!
4. Ensure the test suite passes (`yarn test`). Tip: `yarn test --watch TestName` is helpful in development.
5. Run `yarn test --prod` to test in the production environment.
6. If you need a debugger, run `yarn debug-test --watch TestName`, open `chrome://inspect`, and press "Inspect".
7. Format your code with [prettier](https://github.com/prettier/prettier) (`yarn prettier`).
8. Make sure your code lints (`yarn lint`). Tip: `yarn linc` to only check changed files.
9. Run the [Flow](https://flowtype.org/) typechecks (`yarn flow`).
10. If you haven't already, complete the CLA.
>>>>>>> 3844da103db4c2dea4783f5b3a2a0b53708d04ab

### Contributor License Agreement (CLA) {#contributor-license-agreement-cla}

Expand All @@ -112,6 +125,7 @@ Public API를 변경하거나 구현을 간단하게 변경하려 할 때 [이

React 저장소를 복사한 후 yarn 명령을 사용하면 다음과 같은 여러 명령을 실행할 수 있습니다.

<<<<<<< HEAD
* `yarn lint` 코드 스타일을 점검합니다.
* `yarn linc` 는 `yarn lint`와 비슷하지만, 브랜치에서 변경된 파일만 검사하기 때문에 더 빠릅니다.
* `yarn test` 는 모든 테스트를 실행합니다.
Expand All @@ -122,6 +136,18 @@ React 저장소를 복사한 후 yarn 명령을 사용하면 다음과 같은
* `yarn flow` 는 [Flow](https://flowtype.org/) 타입검사를 실행합니다.
* `yarn build` 는 모든 패키지와 함께 `build` 폴더를 만듭니다.
* `yarn build react/index,react-dom/index --type=UMD`는 React와 ReactDOM의 UMD 빌드를 만듭니다.
=======
* `yarn lint` checks the code style.
* `yarn linc` is like `yarn lint` but faster because it only checks files that differ in your branch.
* `yarn test` runs the complete test suite.
* `yarn test --watch` runs an interactive test watcher.
* `yarn test --prod` runs tests in the production environment.
* `yarn test <pattern>` runs tests with matching filenames.
* `yarn debug-test` is just like `yarn test` but with a debugger. Open `chrome://inspect` and press "Inspect".
* `yarn flow` runs the [Flow](https://flowtype.org/) typechecks.
* `yarn build` creates a `build` folder with all the packages.
* `yarn build react/index,react-dom/index --type=UMD` creates UMD builds of just React and ReactDOM.
>>>>>>> 3844da103db4c2dea4783f5b3a2a0b53708d04ab

변경 작업이 이상이 없는지 확인하기 위해 `yarn test`(또는 이것과 비슷한 명령)을 통해 확인해주세요. 직접 수정한 React 빌드를 사용해보는 게 도움이 될 수 있습니다.

Expand Down
29 changes: 29 additions & 0 deletions content/docs/reconciliation.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ React에 이 알고리즘을 적용한다면, 1000개의 엘리먼트를 그리

두 루트 엘리먼트의 타입이 다르면, React는 이전 트리를 버리고 완전히 새로운 트리를 구축합니다. `<a>`에서 `<img>`로, `<Article>`에서 `<Comment>`로, 혹은 `<Button>`에서 `<div>`로 바뀌는 것 모두 트리 전체를 재구축하는 경우입니다.

<<<<<<< HEAD
트리를 버릴 때 이전 DOM 노드들은 모두 파괴됩니다. 컴포넌트 인스턴스는 `componentWillUnmount()`가 실행됩니다. 새로운 트리가 만들어질 때, 새로운 DOM 노드들이 DOM에 삽입됩니다. 그에 따라 컴포넌트 인스턴스는 `componentWillMount()`가 실행되고 `componentDidMount()`가 이어서 실행됩니다. 이전 트리와 연관된 모든 state는 사라집니다.
=======
When tearing down a tree, old DOM nodes are destroyed. Component instances receive `componentWillUnmount()`. When building up a new tree, new DOM nodes are inserted into the DOM. Component instances receive `UNSAFE_componentWillMount()` and then `componentDidMount()`. Any state associated with the old tree is lost.
>>>>>>> 3844da103db4c2dea4783f5b3a2a0b53708d04ab

루트 엘리먼트 아래의 모든 컴포넌트도 언마운트되고 그 state도 사라집니다. 예를 들어, 아래와 같은 비교가 일어나면,

Expand All @@ -43,7 +47,17 @@ React에 이 알고리즘을 적용한다면, 1000개의 엘리먼트를 그리

이전 `Counter`는 사라지고, 새로 다시 마운트가 될 것입니다.

<<<<<<< HEAD
### DOM 엘리먼트의 타입이 같은 경우 {#dom-elements-of-the-same-type}
=======
>Note:
>
>These methods are considered legacy and you should [avoid them](/blog/2018/03/27/update-on-async-rendering.html) in new code:
>
>- `UNSAFE_componentWillMount()`

### DOM Elements Of The Same Type {#dom-elements-of-the-same-type}
>>>>>>> 3844da103db4c2dea4783f5b3a2a0b53708d04ab

같은 타입의 두 React DOM 엘리먼트를 비교할 때, React는 두 엘리먼트의 속성을 확인하여, 동일한 내역은 유지하고 변경된 속성들만 갱신합니다. 예를 들어,

Expand All @@ -69,11 +83,26 @@ DOM 노드의 처리가 끝나면, React는 이어서 해당 노드의 자식들

### 같은 타입의 컴포넌트 엘리먼트 {#component-elements-of-the-same-type}

<<<<<<< HEAD
컴포넌트가 갱신되면 인스턴스는 동일하게 유지되어 렌더링 간 state가 유지됩니다. React는 새로운 엘리먼트의 내용을 반영하기 위해 현재 컴포넌트 인스턴스의 props를 갱신합니다. 이때 해당 인스턴스의 `componentWillReceiveProps()`와 `componentWillUpdate()`를 호출합니다.
=======
When a component updates, the instance stays the same, so that state is maintained across renders. React updates the props of the underlying component instance to match the new element, and calls `UNSAFE_componentWillReceiveProps()`, `UNSAFE_componentWillUpdate()` and `componentDidUpdate()` on the underlying instance.
>>>>>>> 3844da103db4c2dea4783f5b3a2a0b53708d04ab

다음으로 `render()` 메소드가 호출되고 비교 알고리즘이 이전 결과와 새로운 결과를 재귀적으로 처리합니다.

<<<<<<< HEAD
## 자식에 대한 재귀적 처리 {#recursing-on-children}
=======
>Note:
>
>These methods are considered legacy and you should [avoid them](/blog/2018/03/27/update-on-async-rendering.html) in new code:
>
>- `UNSAFE_componentWillUpdate()`
>- `UNSAFE_componentWillReceiveProps()`

### Recursing On Children {#recursing-on-children}
>>>>>>> 3844da103db4c2dea4783f5b3a2a0b53708d04ab

DOM 노드의 자식들을 재귀적으로 처리할 때, React는 기본적으로 동시에 두 리스트를 순회하고 차이점이 있으면 변경을 생성합니다.

Expand Down
3 changes: 2 additions & 1 deletion vercel.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
{ "source": "/link/test-utils-mock-component", "destination": "https://gist.github.com/bvaughn/fbf41b3f895bf2d297935faa5525eee9", "permanent": false },
{ "source": "/link/uselayouteffect-ssr", "destination": "https://gist.github.com/gaearon/e7d97cdf38a2907924ea12e4ebdf3c85", "permanent": false },
{ "source": "/link/react-devtools-faq", "destination": "https://github.com/facebook/react/tree/master/packages/react-devtools#faq", "permanent": false },
{ "source": "/link/setstate-in-render", "destination": "https://github.com/facebook/react/issues/18178#issuecomment-595846312", "permanent": false }
{ "source": "/link/setstate-in-render", "destination": "https://github.com/facebook/react/issues/18178#issuecomment-595846312", "permanent": false },
{ "source": "/version/15.6", "destination": "https://react-legacy.netlify.app", "permanent": false }
]
}