You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/docs/reconciliation.md
+9-25
Original file line number
Diff line number
Diff line change
@@ -27,11 +27,7 @@ React에 이 알고리즘을 적용한다면, 1000개의 엘리먼트를 그리
27
27
28
28
두 루트 엘리먼트의 타입이 다르면, React는 이전 트리를 버리고 완전히 새로운 트리를 구축합니다. `<a>`에서 `<img>`로, `<Article>`에서 `<Comment>`로, 혹은 `<Button>`에서 `<div>`로 바뀌는 것 모두 트리 전체를 재구축하는 경우입니다.
29
29
30
-
<<<<<<< HEAD
31
-
트리를 버릴 때 이전 DOM 노드들은 모두 파괴됩니다. 컴포넌트 인스턴스는 `componentWillUnmount()`가 실행됩니다. 새로운 트리가 만들어질 때, 새로운 DOM 노드들이 DOM에 삽입됩니다. 그에 따라 컴포넌트 인스턴스는 `componentWillMount()`가 실행되고 `componentDidMount()`가 이어서 실행됩니다. 이전 트리와 연관된 모든 state는 사라집니다.
32
-
=======
33
-
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.
34
-
>>>>>>> 35179e85933265cb7a4f5d51c10fbe70deba3787
30
+
트리를 버릴 때 이전 DOM 노드들은 모두 파괴됩니다. 컴포넌트 인스턴스는 `componentWillUnmount()`가 실행됩니다. 새로운 트리가 만들어질 때, 새로운 DOM 노드들이 DOM에 삽입됩니다. 그에 따라 컴포넌트 인스턴스는 `UNSAFE_componentWillMount()`가 실행되고 `componentDidMount()`가 이어서 실행됩니다. 이전 트리와 연관된 모든 state는 사라집니다.
35
31
36
32
루트 엘리먼트 아래의 모든 컴포넌트도 언마운트되고 그 state도 사라집니다. 예를 들어, 아래와 같은 비교가 일어나면,
37
33
@@ -47,17 +43,13 @@ When tearing down a tree, old DOM nodes are destroyed. Component instances recei
47
43
48
44
이전 `Counter`는 사라지고, 새로 다시 마운트가 될 것입니다.
49
45
50
-
<<<<<<< HEAD
51
-
### DOM 엘리먼트의 타입이 같은 경우 {#dom-elements-of-the-same-type}
52
-
=======
53
-
>Note:
46
+
>주의
54
47
>
55
-
>These methods are considered legacy and you should [avoid them](/blog/2018/03/27/update-on-async-rendering.html) in new code:
48
+
>아래 메서드들은 레거시이며 새로 작성하는 코드에서는 [피해야 합니다.](/blog/2018/03/27/update-on-async-rendering.html)
56
49
>
57
50
>-`UNSAFE_componentWillMount()`
58
51
59
-
### DOM Elements Of The Same Type {#dom-elements-of-the-same-type}
60
-
>>>>>>> 35179e85933265cb7a4f5d51c10fbe70deba3787
52
+
### DOM 엘리먼트의 타입이 같은 경우 {#dom-elements-of-the-same-type}
61
53
62
54
같은 타입의 두 React DOM 엘리먼트를 비교할 때, React는 두 엘리먼트의 속성을 확인하여, 동일한 내역은 유지하고 변경된 속성들만 갱신합니다. 예를 들어,
63
55
@@ -83,26 +75,18 @@ DOM 노드의 처리가 끝나면, React는 이어서 해당 노드의 자식들
83
75
84
76
### 같은 타입의 컴포넌트 엘리먼트 {#component-elements-of-the-same-type}
85
77
86
-
<<<<<<< HEAD
87
-
컴포넌트가 갱신되면 인스턴스는 동일하게 유지되어 렌더링 간 state가 유지됩니다. React는 새로운 엘리먼트의 내용을 반영하기 위해 현재 컴포넌트 인스턴스의 props를 갱신합니다. 이때 해당 인스턴스의 `componentWillReceiveProps()`와 `componentWillUpdate()`를 호출합니다.
88
-
=======
89
-
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.
90
-
>>>>>>> 35179e85933265cb7a4f5d51c10fbe70deba3787
78
+
컴포넌트가 갱신되면 인스턴스는 동일하게 유지되어 렌더링 간 state가 유지됩니다. React는 새로운 엘리먼트의 내용을 반영하기 위해 현재 컴포넌트 인스턴스의 props를 갱신합니다. 이때 해당 인스턴스의 `UNSAFE_componentWillReceiveProps()`, `UNSAFE_componentWillUpdate()`, `componentDidUpdate`를 호출합니다.
91
79
92
-
다음으로 `render()`메소드가 호출되고 비교 알고리즘이 이전 결과와 새로운 결과를 재귀적으로 처리합니다.
80
+
다음으로 `render()`메서드가 호출되고 비교 알고리즘이 이전 결과와 새로운 결과를 재귀적으로 처리합니다.
93
81
94
-
<<<<<<< HEAD
95
-
## 자식에 대한 재귀적 처리 {#recursing-on-children}
96
-
=======
97
-
>Note:
82
+
>주의
98
83
>
99
-
>These methods are considered legacy and you should [avoid them](/blog/2018/03/27/update-on-async-rendering.html) in new code:
84
+
>아래 메서드들은 레거시이며 새로 작성하는 코드에서는 [피해야 합니다.](/blog/2018/03/27/update-on-async-rendering.html)
100
85
>
101
86
>-`UNSAFE_componentWillUpdate()`
102
87
>-`UNSAFE_componentWillReceiveProps()`
103
88
104
-
### Recursing On Children {#recursing-on-children}
105
-
>>>>>>> 35179e85933265cb7a4f5d51c10fbe70deba3787
89
+
## 자식에 대한 재귀적 처리 {#recursing-on-children}
106
90
107
91
DOM 노드의 자식들을 재귀적으로 처리할 때, React는 기본적으로 동시에 두 리스트를 순회하고 차이점이 있으면 변경을 생성합니다.
0 commit comments