Skip to content

[Suggestion]: Add Async React Hooks section to hooks #8316

@MaxwellCohen

Description

@MaxwellCohen

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions