resolvers
resolvers copied to clipboard
issue: [yup] Schemas with optional fields cause type errors
Version Number
5.0.1
Codesandbox/Expo snack
https://codesandbox.io/p/sandbox/react-hook-form-resolver-issue-2t3cqg
Steps to reproduce
- Open Codesandbox url
- See line 13 of src/App.tsx
- The following type error occurs.
Type 'Resolver<{ hoge: string | undefined; }, any, { hoge?: string | undefined; }>' is not assignable to type 'Resolver<{ hoge?: string | undefined; }, any, { hoge?: string | undefined; }>'. Types of parameters 'values' and 'values' are incompatible. Type '{ hoge?: string | undefined; }' is not assignable to type '{ hoge: string | undefined; }'.typescript(2322)
Expected behaviour
No type errors
What browsers are you seeing the problem on?
No response
Relevant log output
Code of Conduct
- [x] I agree to follow this project's Code of Conduct