Skip to content

Commit 849c8ce

Browse files
authored
Merge pull request #4841 from BonaventureCJ/docs/fix-rtk-thunk-typo
docs(part-5): fix thunk logic grammatical error
2 parents 09c99bd + 7874b01 commit 849c8ce

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/tutorials/essentials/part-5-async-logic.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ In this case, what happened is:
589589
- The `useEffect` hook ran for the first time. The `postStatus` value is `'idle'`, so it dispatches the `fetchPosts` thunk.
590590
- `fetchPosts` immediately dispatches its `fetchPosts.pending` action, so the Redux store _did_ update the status to `'pending'` right away...
591591
- **but React runs the `useEffect` _again_ without re-rendering the component, so the effect still thinks that `postStatus` is `'idle'` and dispatches `fetchPosts` a second time**
592-
- Both thunks finish fetching their data, dispatch the `fetchPosts.fulfilled` action, and the `fulfilled` reducer runs twice, adding resulting in a duplicate set of posts being added to the state
592+
- Both thunks finish fetching their data and dispatch the `fetchPosts.fulfilled` action; consequently, the `fulfilled` reducer runs twice, resulting in a duplicate set of posts being added to the state
593593

594594
So, how can we fix this?
595595

0 commit comments

Comments
 (0)