How to deal with null values in forms? #1086
Unanswered
verheyenkoen
asked this question in
Q&A
Replies: 1 comment 3 replies
-
@verheyenkoen I have just asked myself exactly the same question. Have you been able to solve the problem for yourself? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a drizzle schema that has an optional/nullable varchar-field. When I load a record from the database and try to bind the optional value to an
<input>
, Typescript complains because thevalue
prop doesn't allownull
-values. It does however allow forundefined
values. So is there a way to have a record loaded and thenull
-values automatically converted toundefined
so they can be directly bound to form fields without having to run them through a conversion function.I know I can also make the field
.notNull()
with an empty string default but that does feel like the wrong way to fix this.Beta Was this translation helpful? Give feedback.
All reactions