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
{{ message }}
Repository navigation
Commit 6455acd
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: src/content/learn/extracting-state-logic-into-a-reducer.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -183,11 +183,11 @@ Each of its event handlers calls `setTasks` in order to update the state. As thi
183
183
184
184
Reducers are a different way to handle state. You can migrate from `useState` to `useReducer` in three steps:
185
185
186
-
1.**Move** from setting state to dispatching actions.
186
+
1.**Move** from setting state to dispatching Actions.
187
187
2.**Write** a reducer function.
188
188
3.**Use** the reducer from your component.
189
189
190
-
### Step 1: Move from setting state to dispatching actions {/*step-1-move-from-setting-state-to-dispatching-actions*/}
190
+
### Step 1: Move from setting state to dispatching Actions {/*step-1-move-from-setting-state-to-dispatching-actions*/}
191
191
192
192
Your event handlers currently specify _what to do_ by setting state:
193
193
@@ -862,7 +862,7 @@ li {
862
862
863
863
</Sandpack>
864
864
865
-
Component logic can be easier to read when you separate concerns like this. Now the event handlers only specify _what happened_ by dispatching actions, and the reducer function determines _how the state updates_ in response to them.
865
+
Component logic can be easier to read when you separate concerns like this. Now the event handlers only specify _what happened_ by dispatching Actions, and the reducer function determines _how the state updates_ in response to them.
866
866
867
867
## Comparing `useState` and `useReducer` {/*comparing-usestate-and-usereducer*/}
0 commit comments