How to deal with null values in forms? #1086
Unanswered
verheyenkoen
asked this question in
Q&A
Replies: 1 comment 2 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.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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