PabloP
Convex Community5mo ago
5 replies
Pablo

Hello! It's me again, with the weird

Hello! It's me again, with the weird validation problems. So I dropped Zod and wrote the validations by hand and I created what I think is the smallest, most type correct example of what happens when you have optional numbers and you are using React Hook Form (I think this also happens with TanStack Form), React, NextJS and Convex. It's here:

https://github.com/pupeno/convex-nextjs-playground

The problem boils down to the form using
""
to represent blanks, the API using
null
to represent blanks, and the database using
undefined
to represent blanks, which ends up creating a lot of types and a lot of conversion issues. My question for any kind soul here is, am I missing something? Can I simplify this somehow?
Was this page helpful?