Skip to content

Is this demo in the React doc an incorrect usage of startTransition? #8158

Closed

Description

@ZJRui
Image https://react.dev/reference/rsc/server-functions#server-functions-with-actions
  1. Shouldn't setError and setName need to be wrapped with a new startTransition?
  2. It seems meaningless to apply startTransition to await updateName in the document, doesn't it?

https://react.dev/reference/react/useTransition#react-doesnt-treat-my-state-update-after-await-as-a-transition

Activity

  1. aurorascharff commented on Nov 7, 2026

    @aurorascharff
    Collaborator

    Thanks for catching this! The current example wraps setError and setName in an additional startTransition after await. The outer Transition tracks the async Action. Closing this as resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions