code-forge-io / code-forge-io/remix-hook-form
TypeError with the control object
- Dominant language
- TypeScript
- Stars
- 453
- Forks
- 43
- PR merge metrics
- No merged PRs in 30d
Description
Got:
```
Type 'Control<{ email: string; password: string; }, any>' is not assignable to type 'Control<{ email: string; password: string; }>'.
Types of property '_updateFieldArray' are incompatible.
Type 'import("/xxx/node_modules/react-hook-form/dist/types/form").BatchFieldArrayUpdate' is not assignable to type 'import("/xxx/node_modules/react-hook-form/dist/types/form").BatchFieldArrayUpdate'.
Types of parameters 'updatedFieldArrayValues' and 'updatedFieldArrayValues' are incompatible.
Type 'Partial>[] | undefined' is not assignable to type 'Partial>>[] | undefined'.
Type 'Partial>[]' is not assignable to type 'Partial>>[]'.
Type 'Partial>' is not assignable to type 'Partial>>'.
Type 'keyof FieldArray>' is not assignable to type 'keyof FieldArray'.
Type 'string | number | symbol' is not assignable to type 'keyof FieldArray'.
Type 'string' is not assignable to type 'keyof FieldArray'.
Type 'string' is not assignable to type 'never'.
Type 'keyof FieldArray>' is not assignable to type 'never'.
Type 'string | number | symbol' is not assignable to type 'never'.
Type 'string' is not assignable to type 'never'.ts(2322)
```
Code:
```typescript
const schema = zod.object({
email: zod.string().email().min(1),
password: zod
.string()
.regex(/^(?=.*[A-Z])(?=.*[a-z])(?=.*d).+$/)
.min(8),
});
export default function Login() {
const {
handleSubmit,
formState: { errors },
control,
} = useRemixForm>({
mode: "onSubmit",
resolver: zodResolver(schema),
});
return (
(
)}
/>
);
}
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.