Skip to content

[react-form-start] Cannot restore form state after post-validation submission errors #2272

Description

@juanmarin-co

Observed behavior

With a native TanStack Start form:

<form action={submitForm.url} method="post">

createServerValidate correctly preserves values and errors when server validation fails.

However, if validation succeeds and the subsequent mutation returns a domain error, there is no public API to persist an arbitrary ServerFormState across the redirect:

const values = await serverValidate(formData);
const result = await createResource(values);

if (!result.success) {
  // Cannot restore `values` with field/form errors after redirecting.
}

Returning the form state from the server function navigates the browser to the raw server-function response instead of restoring the original form.

Expected behavior

@tanstack/react-form-start should provide a public API to persist an arbitrary ServerFormState and redirect back to the form, using the same restoration mechanism as createServerValidate.

This would allow post-validation mutation errors to preserve submitted values and populate form-level or field-level errors after the POST/Redirect/GET cycle.

Version: @tanstack/react-form-start@1.33.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    v1This issue has been created during v1 development.v2: needs investigationThis hasn't been confirmed or denied in v2 yet.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions