[react-form-start] Cannot restore form state after post-validation submission errors
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 6.7k
- Forks
- 682
- Avg merge
- 5d 18h
- Merged PRs (30d)
- 7
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing createServerValidate and the ServerFormState restoration flow in @tanstack/react-form-start, focusing on native POST forms and the redirect cycle. Define how an arbitrary state from a post-validation mutation error can be persisted and restored without navigating to the raw server-function response. Done means form values and field-level or form-level errors survive the POST/Redirect/GET flow through a public API.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100