Browse Source

docs: fix a grammatical error (#4183)

Co-authored-by: dan <dan.abramov@gmail.com>
main
Sofya Tuymedova 3 years ago
committed by GitHub
parent
commit
466809e8f4
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      beta/src/pages/learn/extracting-state-logic-into-a-reducer.md

2
beta/src/pages/learn/extracting-state-logic-into-a-reducer.md

@ -224,7 +224,7 @@ Remove all the state setting logic. What you are left with are three event handl
* `handleChangeTask(task)` is called when the user toggles a task or presses "Save".
* `handleDeleteTask(taskId)` is called when the user presses "Delete".
Managing state with reducers is slightly different from directly setting state. Instead of telling React "what to do" by setting state, you specify "what the user just did" by dispatching "actions" from your event handlers. (The state update logic will live elsewhere!) So instead of "setting `tasks`" via event handler, you're dispatching an "added/changed/deleted a task" action. This is more descriptive of the user's intent.
Managing state with reducers is slightly different from directly setting state. Instead of telling React "what to do" by setting state, you specify "what the user just did" by dispatching "actions" from your event handlers. (The state update logic will live elsewhere!) So instead of "setting `tasks`" via an event handler, you're dispatching an "added/changed/deleted a task" action. This is more descriptive of the user's intent.
```js
function handleAddTask(text) {

Loading…
Cancel
Save