-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
Closed
Labels
Description
What problem does this feature solve?
Currently prop type checking fails when passing in an object that extends the expected type.
This would allow anything inheriting from the expected type to pass the check.
What does the proposed API look like?
Line 148 in 8d66691
valid = typeof value === expectedType.toLowerCase() |
If this line were
valid = value instanceof expectedType.toLowerCase()
Then child classes would also pass. In my mind if a component is checking for String
and I pass in an object that extends string this should pass the typecheck.
This was born out of an issue that one of my users has passing an String castable object which extends string as a prop into a Vue component.
If you're interested you can check that out here:
calebporzio