Skip to content

Document the formState option for hydrateRoot - #8633

Closed
eps1lon wants to merge 1 commit into
reactjs:mainfrom
eps1lon:sebbie/hydrateroot-formstate
Closed

Document the formState option for hydrateRoot#8633
eps1lon wants to merge 1 commit into
reactjs:mainfrom
eps1lon:sebbie/hydrateroot-formstate

Conversation

@eps1lon

@eps1lon eps1lon commented Sep 2, 2026

Copy link
Copy Markdown
Member

This adds the formState option to the hydrateRoot reference. The option carries the form state produced by a Server Function form submission so that useActionState with a permalink returns the submitted state during hydration instead of the initial state, and it must match the formState passed to the server renderer. The option shipped in React 19.0 but was never documented.

Verified against HydrateRootOptions at react/react@f4e439e198 and the published react-dom@19.2.8 stable bundle, which already supports the option (so no Canary badge).

This adds the `formState` option to the `hydrateRoot` reference. The option carries the form state produced by a Server Function form submission so that `useActionState` with a `permalink` returns the submitted state during hydration instead of the initial state, and it must match the `formState` passed to the server renderer. The option shipped in React 19.0 but was never documented.

Co-Authored-By: Claude Code (kimi-k3[1m]) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

Size changes

Details

📦 Next.js Bundle Analysis for react-dev

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

@eps1lon

eps1lon commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

Folded into #8632 since both touch formState.

@eps1lon eps1lon closed this Sep 2, 2026
@eps1lon
eps1lon deleted the sebbie/hydrateroot-formstate branch September 2, 2026 18:43
@eps1lon

eps1lon commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

Folded into #8632

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant