Submit "null" value #344
Unanswered
ruigomeseu
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
If I have a field that can be either null or a number.
I have my validator setup so it accepts the string 'Default' instead of null, to avoid confusion between a empty field and actually null.
It appears that the
transform
is affecting the type offield
, since I get this TypeScript error:Type 'string | number' is not assignable to type 'number | null | undefined'.
(this is when setting the defaultValues.field)account.field is a
Number
.Is there any workaround so my form input can accept 'Default' or a number, and my
action
receives a Number or null, without me having to transformfield
inside the action itself?Beta Was this translation helpful? Give feedback.
All reactions