-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
Prop with validator breaks prop types for component #2474
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Use arrow function instead, or explicitly add an annotation to |
Ah yeah it's vuejs/vue#8679 again, thanks. |
I would like to add that this is a design limitation in TypeScript; see this issue microsoft/TypeScript#38845. And I believe that the example under Annotating Props in the docs will have this problem as well. |
/cc @vuejs/docs |
Documentation as been amended with proper instructions, we can close this here. |
Still encountered the same issue even if following doc... (vue 3.0.7, typescript 4.2.3) |
Uh oh!
There was an error while loading. Please reload this page.
Version
3.0.2
Reproduction link
https://codesandbox.io/s/blissful-darwin-mi9ul
Steps to reproduce
Try to access
props.type
What is expected?
No error
What is actually happening?
Property 'type' does not exist on type 'Readonly<...
Removing the validator or using
as Prop<string>
fixes the error, but it should be inferred without breaking the component.The text was updated successfully, but these errors were encountered: