reactjs / reactjs/react.dev

[Suggestion]: Add Async React Hooks section to hooks

Open
#8,316 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: documentation
Dominant language
JavaScript
Stars
11.8k
Forks
7.9k
Avg merge
1d 11h
Merged PRs (30d)
11

Description

Summary

Update the hooks page to include a section on Async React hooks useTransition, useActionState, and useOptimistic

Page

https://react.dev/reference/react/hooks

Details

The current hooks page has a very React 18 thinking of useTransition (in the Performance Hooks section), useActionState (in other hooks), and is missing the useOptimistic hook. I believe these hooks are better served by being placed in a single section to help spread the React 19 thinking about these hooks.

Proposed Async React Hooks section


Async React Hooks {/async-react-hooks/}

Async React lets you build responsive apps by running async work in Actions callbacks passed to startTransition or action props. State updates from useActionState and useOptimistic must run inside an Action.

  • useTransition lets you mark state updates as non-blocking so the UI stays responsive while they run.
  • useActionState lets you update state from an Action, for form submissions or async reducers.
  • useOptimistic lets you show a temporary UI state while an Action is running.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the React hooks page linked in the issue and review how the existing Performance Hooks and other hooks sections are organized. Add an Async React Hooks section covering useTransition, useActionState, and useOptimistic as proposed, then verify the page links and wording are accurate.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.