Skip to content

Commit ae5c052

Browse files
authored
docs: add useOptimistic to Built-in React Hooks overview (#8625)
Co-authored-by: Iitian001 <Iitian001@users.noreply.github.com>
1 parent 5532a01 commit ae5c052

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)