You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As SubmissionResult['status'] can be error, success or undefined, discriminated union not working so fine.
So why do you choose to not split error and success state in submission result?
And if this isn't a particular choice, are you planning to make this type in another way in a near future?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
I am working on nextJS project with conform & zod.
So when I follow conform example for validation, so I have this kind of action:
So my action return type is the discriminated union:
But as
SubmissionResult
have this definition:As
SubmissionResult['status']
can beerror
,success
orundefined
, discriminated union not working so fine.So why do you choose to not split
error
andsuccess
state in submission result?And if this isn't a particular choice, are you planning to make this type in another way in a near future?
Thanks for your time
Beta Was this translation helpful? Give feedback.
All reactions