Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yup resolver { stripUnknown: true } schemaOption no longer working #170

Closed
vanyadymousky opened this issue May 28, 2021 · 3 comments · Fixed by #172
Closed

Yup resolver { stripUnknown: true } schemaOption no longer working #170

vanyadymousky opened this issue May 28, 2021 · 3 comments · Fixed by #172

Comments

@vanyadymousky
Copy link

Hello! My first issue here. First of all thanks for amazing library, it's a real time and life saver tool!
So I've decided to update from resolvers v2.0.0-rc.1 and react-hook-form v6.x to both latest.

Describe the bug
Using stripUnknown via yupResolver no longer working: empty data all the time, no validation working

Using resolvers v2.5.1 and react hook form v7.6.9

To Reproduce
Use yupResolver(schema, { stripUnknown: true })

Codesandbox link (Required)
https://codesandbox.io/s/brave-ellis-gunj5?file=/src/App.tsx

Expected behavior

  • no data should be submitted until validation passes
  • validation should work correctly
  • after validation errors are fixed all data (defined in schema, unknown stripped, obviously) should be submitted correctly

Screenshots
Screenshot 2021-05-28 at 6 39 08 PM

Desktop (please complete the following information):

  • OS: Mac OS BigSur 11.3 (20E232) (Intel)
  • Chrome
  • Version 90.0.4430.212 (Official Build) (x86_64)

Additional context
Was working fine on react-hook-form v6.x and resolvers v2.0.0-rc.1

@vanyadymousky
Copy link
Author

Please LMK if I should submit this to react-hook-form repo!

@jorisre
Copy link
Member

jorisre commented May 30, 2021

Hi @vanyadymousky
Thank you for reporting the issue. I've opened a PR to fix it.
Feel free to review it #172

@jorisre
Copy link
Member

jorisre commented May 31, 2021

@vanyadymousky Should be fixed in the last version v2.5.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants