Gludek - Just to confirm z.string().email() can...
Just to confirm
z.string().email()
can't be combined with .nullish()
right?6 Replies
I don't see why it wouldn't be able to,
nullish
just adds undefined | null
to the type.yeah, but regex validation of .email makes it so it needs to be defined, and null/undefined input is treated as invalid
Your form most likely is not passing
null
or undefined
, most likely you have ""
Solution
Perhaps you're looking for:
okay that works