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
Uh oh!
There was an error while loading. Please reload this page.
-
I use a component from a library that has the following props definition:
When I pass
nullas a value formodelValue, it works fine with Vue (no props warning), butvue-tscdoes not allow it and throws the following error:I’m wondering why it allows
undefinedbut notnull? This is different from Vue internal props validator. Having to explicitly acceptnullfor every optional props sounds weird to me, but I’m probably missing something?Beta Was this translation helpful? Give feedback.
All reactions