Search code examples
reactjstypescriptyup

Yup Resolver started casting error that type is not assignable


I'm currently using @hookform/resolvers version 3.9.0 and it started casting an error. This is my code:

const form = useForm<FormType>({
    defaultValues: { ...defaultFormFieldValues },
    resolver: yupResolver(schema),
    mode: 'onChange',
  });

The resolver then casts

Type 'Resolver<{val1: string}>' is not assignable to type Resolver<FormType,any>'
Types of parameters 'values' and 'values' are incompatible.
Type 'FormType' is not assignable with '{val1:string}'

This has never been an issue before and downgrading seems to solve the issue. I can't seem to find anything about this being a bug anywhere. Anyone else having this issue?


Solution

  • I had dependency issues which needed to be fixed.