Check out our talk at Remix Conf!

onBlur mode

In this example, client-side validations will happen when the user leaves a field.

const schema = z.object({
  firstName: z.string().nonempty(),
  email: z.string().nonempty().email(),
})

const mutation = makeDomainFunction(schema)(async (values) => values)

export const action: ActionFunction = async ({ request }) =>
  formAction({ request, schema, mutation })

export default () => <Form schema={schema} mode="onBlur" />