yupResolver raise Types of parameters 'options' and 'options' are incompatible at react-hook-form 7.15.0
See original GitHub issueHello.
Describe the bug
I updated react-hook-form 7.15.0, yupResolver raise following type error messages.
Type '<TFieldValues extends Record<string, any>, TContext>(values: UnpackNestedValue<TFieldValues>, context: TContext | undefined, options: ResolverOptions<TFieldValues>) => Promise<...>' is not assignable to type 'Resolver<FormType, object>'.
Types of parameters 'options' and 'options' are incompatible.
Same code with react-hook-form 7.14.2 works fine(no type error).
versions
- react: 17.0.2
- react-hook-form: 7.15.0
- @hookform/resolvers: 2.8.0
- dayjs: 1.10.6
- yup: 0.32.9
- typescript: 4.3.5
To Reproduce
- Go to https://codesandbox.io/s/sad-wilson-rvpvv?file=/src/App.tsx
- move mouse cursor to line 22 and hover
resolver
- Error message popup.
Codesandbox link (Required)
https://codesandbox.io/s/sad-wilson-rvpvv?file=/src/App.tsx:456-464
Expected behavior
No type error raised, or I want to know how to avoid type error (react-hook-form 7.14.2 works fine)
Screenshots

Desktop (please complete the following information):
- OS: macOS
- Browser Chrome
- Version 92.0.4515.159(Official Build) (x86_64)
Additional context
None
Thank you!
Issue Analytics
- State:
- Created 2 years ago
- Reactions:6
- Comments:24 (9 by maintainers)
Top Results From Across the Web
TS Support | React Hook Form - Simple React forms validation
Performant, flexible and extensible forms with easy-to-use validation.
Read more >signature for type 'string' is missing error when assigning Yup ...
I'm using material ui with react-hook-form and yup to create and ... n Types of parameters 'options' and 'options' are incompatible.
Read more >react-hook-form | Yarn - Package Manager
Performant, flexible and extensible forms library for React Hooks. react, hooks, form ... React Hook Form Logo - React hook custom hook for...
Read more >React Hook Form - Reset form with default values and clear ...
The solution is to use the reset() function from the React Hook Form library, if you execute the function without any parameters (...
Read more >API Documentation - Simple React forms validation
useForm also has optional arguments. The following example demonstrates all options' default value. const { register } = useForm ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi, My current setup is:
“@hookform/resolvers”: “^2.8.1”, “react-hook-form”: “7.15.4”, “yup”: “^0.32.9”, “@types/yup”: “^0.29.13”
They are the latest versions that are atm available and how I solved the above error is by using the yupResolver with the next generic type yupResolver<yup.AnyObjectSchema>. An example could be the following:
You can also add the defaultValues and I would recommend you to do that.
Hope it helps you 😃
7.16.0 solve the original issue above. the other issue is related to 2.8.1 https://github.com/react-hook-form/resolvers/issues/245