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
Observed behavior
With a native TanStack Start form:
createServerValidatecorrectly 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
ServerFormStateacross the redirect: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-startshould provide a public API to persist an arbitraryServerFormStateand redirect back to the form, using the same restoration mechanism ascreateServerValidate.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