Skip to content

Commit 3b8a41d

Browse files
author
Eunyoung Choi
committed
docs: unify 리듀서 → reducer
1 parent 46a5297 commit 3b8a41d

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/content/learn/reacting-to-input-with-state.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ const [status, setStatus] = useState('typing'); // 'typing', 'submitting', or 's
393393
394394
#### Reducer를 사용하여 "불가능한" state 제거 {/*eliminating-impossible-states-with-a-reducer*/}
395395
396-
여기 폼의 state를 나타내는데 충분한 세 가지 변수가 있습니다. 하지만 세 변수는 여전히 말이 안 되는 일부 중간 state를 가지고 있습니다. 예를 들면 `error`가 null이 아닌데 `status`가 `success`인 것은 말이 되지 않습니다. state를 조금 더 정확하게 모델링하기 위해서는 [리듀서로 분리](/learn/extracting-state-logic-into-a-reducer)하는 방법도 있습니다. 리듀서를 사용하면 여러 state 변수를 하나의 객체로 통합하고 관련된 모든 로직도 합칠 수 있습니다!
396+
여기 폼의 state를 나타내는데 충분한 세 가지 변수가 있습니다. 하지만 세 변수는 여전히 말이 안 되는 일부 중간 state를 가지고 있습니다. 예를 들면 `error`가 null이 아닌데 `status`가 `success`인 것은 말이 되지 않습니다. state를 조금 더 정확하게 모델링하기 위해서는 [reducer로 분리](/learn/extracting-state-logic-into-a-reducer)하는 방법도 있습니다. reducer를 사용하면 여러 state 변수를 하나의 객체로 통합하고 관련된 모든 로직도 합칠 수 있습니다!
397397
398398
</DeepDive>
399399

src/content/reference/react/useReducer.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ function MyComponent() {
3838
3939
#### 매개변수 {/*parameters*/}
4040
41-
* `reducer`: state가 어떻게 업데이트 되는지 지정하는 리듀서 함수입니다. 리듀서 함수는 반드시 순수 함수여야 하며, state와 action을 인수로 받아야 하고, 다음 state를 반환해야 합니다. state와 action에는 모든 데이터 타입이 할당될 수 있습니다.
41+
* `reducer`: state가 어떻게 업데이트 되는지 지정하는 reducer 함수입니다. reducer 함수는 반드시 순수 함수여야 하며, state와 action을 인수로 받아야 하고, 다음 state를 반환해야 합니다. state와 action에는 모든 데이터 타입이 할당될 수 있습니다.
4242
* `initialArg`: 초기 state가 계산되는 값입니다. 모든 데이터 타입이 할당될 수 있습니다. 초기 state가 어떻게 계산되는지는 다음 `init` 인수에 따라 달라집니다.
4343
* **선택사항** `init`: 초기 state를 반환하는 초기화 함수입니다. 이 함수가 인수에 할당되지 않으면 초기 state는 `initialArg`로 설정됩니다. 할당되었다면 초기 state는 `init(initialArg)`를 호출한 결과가 할당됩니다.
4444
@@ -320,7 +320,7 @@ button { display: block; margin-top: 10px; }
320320

321321
#### 투두 리스트 (배열) {/*todo-list-array*/}
322322

323-
이 예시에서는 리듀서를 이용해 할 일 목록들을 배열로 관리합니다. 배열의 업데이트는 [mutation이 없이](/learn/updating-arrays-in-state) 이루어져야 합니다.
323+
이 예시에서는 reducer를 이용해 할 일 목록들을 배열로 관리합니다. 배열의 업데이트는 [mutation이 없이](/learn/updating-arrays-in-state) 이루어져야 합니다.
324324

325325
<Sandpack>
326326

src/sidebarLearn.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@
165165
"path": "/learn/preserving-and-resetting-state"
166166
},
167167
{
168-
"title": "State 로직을 리듀서로 작성하기",
168+
"title": "State 로직을 reducer로 작성하기",
169169
"path": "/learn/extracting-state-logic-into-a-reducer"
170170
},
171171
{

0 commit comments

Comments
 (0)