Can't use Zod/Yup schema for form level validator?
On 0.43.2, when I try to use a Yup or Zod schema at form level, I get a type error for validators.onChange?
https://stackblitz.com/edit/vitejs-vite-bnbraktt?file=src%2Fcomponents%2FForm.tsx
What's the appropriate way to use Yup/Zod now? Dont think we need validatorAdapter anymore.
juanvilladev
StackBlitz
Vitejs - Vite (forked) - StackBlitz
Next generation frontend tooling. It's fast!
7 Replies
like-gold•7mo ago
Try 0.43 it fixed a lot
adverse-sapphireOP•7mo ago
Thanks! Yeah, when I switch to 0.43.0 the issue goes away, but on 0.43.2 the type issue arises
like-gold•7mo ago
Oh wait I missed that
Oh, that's... Weird
Yup doesn't work at all anymore, even with 0.43
But Zod should be working
Can you make a Zod version so I can debug?
adverse-sapphireOP•7mo ago
Gahh TypeScript server in Stackblitz bugging out on me
yeah sure! just a few mins
like-gold•7mo ago
This is what Yup needs for us to support:
https://github.com/jquense/yup/pull/2258
GitHub
feat: Implement standard schema interface by logaretm · Pull Reques...
What
This is a PR that implements the standard schema interface for yup.
Motivation: Standard schema is an initiative that is aimed to get all Typed schema providers to support a unified interface ...
adverse-sapphireOP•7mo ago
https://stackblitz.com/edit/vitejs-vite-j9hrdvnq?file=src%2Fcomponents%2FForm.tsx
Nice! That makes a lot of sense.
Nvm I think we're good on Zod sorry! In my actual repo think I messed something up ^^
juanvilladev
StackBlitz
Vitejs - Vite (forked) - StackBlitz
Next generation frontend tooling. It's fast!
like-gold•7mo ago
No worries 😄