Skip to content

Commit 6a2eba1

Browse files
committed
fix: correct typos in useOptimistic.md
1 parent d46df99 commit 6a2eba1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/content/reference/react/useOptimistic.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,15 +110,15 @@ This state is called the "optimistic" because it is used to immediately present
110110
111111
4. **(Optional) wait for Suspense**: If `newValue` suspends, React continues showing `'b'`.
112112
113-
5. **Single render commit**: Finally, the `newValue` is commits for `value` and `optimistic`.
113+
5. **Single render commit**: Finally, the `newValue` commits for `value` and `optimistic`.
114114
115115
There's no extra render to "clear" the optimistic state. The optimistic and real state converge in the same render when the Transition completes.
116116
117117
<Note>
118118
119119
#### Optimistic state is temporary {/*optimistic-state-is-temporary*/}
120120
121-
Optimistic state is only renders while an Action is in progress, otherwise `value` is rendered.
121+
Optimistic state only renders while an Action is in progress, otherwise `value` is rendered.
122122
123123
If `saveChanges` returned `'c'`, then both `value` and `optimistic` will be `'c'`, not `'b'`.
124124
@@ -403,7 +403,7 @@ export default function App() {
403403
}
404404

405405
if (optimisticIsLiked !== isLiked) {
406-
console.log('✅ rendering optmistic state: ' + optimisticIsLiked);
406+
console.log('✅ rendering optimistic state: ' + optimisticIsLiked);
407407
} else {
408408
console.log('✅ rendering real value: ' + optimisticIsLiked);
409409
}
@@ -1071,7 +1071,7 @@ startTransition(() => {
10711071
})
10721072
```
10731073
1074-
Since `useTransition` uses `useOptimsitic` for `isPending` under the hood, this is equivalent to option 1.
1074+
Since `useTransition` uses `useOptimistic` for `isPending` under the hood, this is equivalent to option 1.
10751075
10761076
3. **Add a `pending` flag in your reducer**
10771077

0 commit comments

Comments
 (0)