Replies: 1 comment 5 replies
-
I am not sure. It should be possible, but I would need to find out some examples to learn from 😅 If anyone figure
What's the blocker? If it is because of |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey 👋
Is it possible to infer string union in default values?
Let's say there's a zod schema
And then
And if used
conform.input()
(yeah, i'm still not on version 1, it's honestly quite painful to upgrade 😅) the default value would be also'typeA' | 'typeB' | undefined
.Why am I proposing this?
I have a big form with a "live preview" window which is real time shows what you're typing. I'm moving the form variables around and some of them are string union and I lose the type safety
Beta Was this translation helpful? Give feedback.
All reactions