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
[Reducer의 개요](/learn/extracting-state-logic-into-a-reducer)의 예시에서 reducer로 state를 관리하는 방법을 알아보았습니다. 해당 예시에서 state 업데이트 로직을 모두 포함하는 reducer 함수를 App.js 파일의 맨 아래에 선언했습니다.
21
+
[Reducer의 개요](/learn/extracting-state-logic-into-a-reducer)의 예시에서 reducer로 state를 관리하는 방법을 알아보았습니다. 해당 예시에서 state 업데이트 로직을 모두 포함하는 reducer 함수를 `App.js` 파일의 맨 아래에 선언했습니다.
Reducer는 이벤트 핸들러를 짧고 간결하게 유지하는 데 도움이 됩니다. 그러나 앱이 커지면 다른 어려움에 부딪힐지도 모릅니다. **현재 `tasks` state 및 `dispatch` 함수는 최상위 `TaskApp` 컴포넌트에서만 사용할 수 있습니다.** 다른 컴포넌트가 작업 목록을 읽거나 변경하려면 현재 state와 해당 state를 변경하는 이벤트 핸들러를 명시적으로 [props로 전달](/learn/passing-props-to-a-component)해야 합니다.
211
211
212
-
예를 들어, `TaskApp`은 tasks 리스트와 이벤트 핸들러를 `TaskList`에 전달합니다.
212
+
예를 들어, `TaskApp`은 `tasks` 리스트와 이벤트 핸들러를 `TaskList`에 전달합니다.
213
213
214
214
```js
215
215
<TaskList
@@ -235,9 +235,9 @@ Reducer는 이벤트 핸들러를 짧고 간결하게 유지하는 데 도움이
235
235
236
236
Reducer와 context를 결합하는 방법은 아래와 같습니다.
237
237
238
-
1. Context를 **생성한다**.
239
-
2.State과 dispatch 함수를 context에 **넣는다**.
240
-
3. 트리 안에서 context를 **사용한다**.
238
+
1. Context를 **생성합니다**.
239
+
2.State와 dispatch 함수를 context에 **넣습니다**.
240
+
3. 트리 안에서 context를 **사용합니다**.
241
241
242
242
### 1단계: Context 생성 {/*step-1-create-the-context*/}
0 commit comments