The result handed straight to useForm
don't
const lastResult = useActionData<typeof action>()
const [form, fields] = useForm({
lastResult,
onValidate: ({ formData }) => parseWithValibot(formData, { schema: signupSchema }),
})do
const lastResult = useActionData<typeof action>()
const navigation = useNavigation()
const [form, fields] = useForm({
lastResult: navigation.state === "idle" ? lastResult : null,
onValidate: ({ formData }) => parseWithValibot(formData, { schema: signupSchema }),
})Verbatim from conform.guide's Remix integration, down to the null rather than undefined. While the navigation is anything but idle, Conform is handed nothing and leaves the form alone.