Why does a non-required prop does not accept null
?
#2497
Unanswered
LeBenLeBen
asked this question in
Q&A
Replies: 1 comment
-
This is |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I use a component from a library that has the following props definition:
When I pass
null
as a value formodelValue
, it works fine with Vue (no props warning), butvue-tsc
does not allow it and throws the following error:I’m wondering why it allows
undefined
but notnull
? This is different from Vue internal props validator. Having to explicitly acceptnull
for every optional props sounds weird to me, but I’m probably missing something?Beta Was this translation helpful? Give feedback.
All reactions