Describe the bug
When there is an optional value in the schema for a form remote function, the field method of the remote function has the following types: field<any>(string: any). So we loose type safety.
Reproduction
<form {...demo}>
<input name={demo.field('demo')} /> <!-- Loose type safety -->
<button type="submit">Demo submit</button>
</form>
export const demo = form(
z.object({
demo: z.string().optional()
}),
(data) => {
console.log(data);
}
);
Logs
System Info
Severity
annoyance
Additional Information
No response