Skip to content

Commit 6be2e2a

Browse files
authored
docs: Add useOptimistic hook description to hooks reference page (#8571)
1 parent 7ca4886 commit 6be2e2a

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎src/content/reference/react/hooks.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ To add state to a component, use one of these Hooks:
1818

1919
* [`useState`](/reference/react/useState) declares a state variable that you can update directly.
2020
* [`useReducer`](/reference/react/useReducer) declares a state variable with the update logic inside a [reducer function.](/learn/extracting-state-logic-into-a-reducer)
21+
* [`useOptimistic`](/reference/react/useOptimistic) lets you show a different state while an async action is pending.
2122

2223
```js
2324
function ImageGallery() {

0 commit comments

Comments
 (0)