People searching “Inertia preserveState” flip the flag on and then a successful save still shows the old error. Inertia already preserves state when validation fails. Forcing it on every response keeps the error after the save too.
TL;DR
- preserveState leaves the current component in place.
- Validation errors stick around if you force it on after a save.
- Do not set
preserveState: trueon a logout request.
The fix#
The form in the CRUD guide can stay on the default. Use the callback when a filter form must keep what the user typed and also drop errors after a clean save.
form.get("/posts", {
preserveState: true,
preserveScroll: true,
});A GET filter should preserve state. The list refreshes, the input keeps the word. A POST that stays on the page is the careful one:
form.post("/comments", {
preserveScroll: true,
preserveState: (page) => Object.keys(page.props.errors).length > 0,
});The callback keeps the component only when the new page still has errors. A clean response replaces local form state, which is what you want after a save.
What to avoid#
Gotcha
Do not set preserveState: true on a logout request. The old page’s props, including the user, stay on screen until something else navigates.
FAQ#
What does preserveState do in Inertia?
preserveState leaves the current component in place. Validation errors stick around if you force it on after a save.
What goes wrong with Inertia preserveState?
Many developers flip the flag on and then a successful save still shows the old error. Do not set preserveState: true on a logout request.



