Replies: 1 comment 2 replies
-
That idea is incompatible with the concept of fallthrough attributes though. |
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
-
While it's logical, and even consistent with other code conventions, when defining props on a component, if invalid prop keys are used, an explicit error should be thrown.
Currently only a unhelpful warning is rendered in the console, but the warning doesn't actually describe the real issue.
For example, if you defined a component prop
key
you will get the following warning even after passing a value for thekey
prop:[Vue warn]: Invalid prop: type check failed for prop "key". Expected String with value "undefined", got Undefined
Contrived example:
Child Component:
Parent Component
This will again render the warning:
[Vue warn]: Invalid prop: type check failed for prop "key". Expected String with value "undefined", got Undefined
By changing our prop to something like, "componentKey", then it works as expected.
I think that where we have component props that are not allowed values, explicit errors should be thrown rather than these undefined warnings which aren't transparent to the real issue.
Beta Was this translation helpful? Give feedback.
All reactions