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) {
}
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