A type-safe form validation library utilizing web fundamentals to progressively enhance HTML Forms with full support for server frameworks like Remix and Next.js.
Hi there, when using Conform with the latest version of Next JS and React I'm getting the following error:
Type 'SubmissionResult<string[]> | { formError: string; } | undefined' is not assignable to type 'SubmissionResult<string[]> | null | undefined'.
Type '{ formError: string; }' has no properties in common with type 'SubmissionResult<string[]>'.ts(2322)
form.d.ts(122, 2): The expected type comes from property 'lastResult' which is declared here on type '{ defaultValue?: { [x: string]: any; } | null | undefined; constraint?: Record<string, Constraint> | undefined; lastResult?: SubmissionResult<string[]> | null | undefined; ... 6 more ...; defaultNoValidate?: boolean | undefined; }'
Describe the bug and the expected behavior
Hi there, when using Conform with the latest version of Next JS and React I'm getting the following error:
Here are the relevant package versions:
Conform version
1.1.5
Steps to Reproduce the Bug or Issue
Here is the affected component in Next JS:
Simply create a file with useActionState and useForm from Conform to reproduce.
What browsers are you seeing the problem on?
Chrome
Screenshots or Videos
No response
Additional context
Here is the relevant example from the docs: https://conform.guide/integration/nextjs
Following this guide can reproduce the bug replacing the deprecated useFormState with useActionState