-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
TS: defineComponent returns incorrect type #730
Comments
@yyx990803 It's still broken in alpha.8. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Version
3.0.0-alpha.4
Reproduction link
https://codesandbox.io/s/boring-cerf-fkv0z
Steps to reproduce
In Typescript, use
defineComponent
to create a component, then try to use it with.component('x-tag', MyComponent)
.What is expected?
TS should compile (it does run).
What is actually happening?
There is a type error at compilation.
The problem seems to be that
defineComponent
is lying about its return type. It says that it returns a constructor, which is not true since it is mostly a noop (it returns its parameter directly, which is an object).createApp
accepts this because it seems to accept constructors in addition to components. But.component()
does not.The text was updated successfully, but these errors were encountered: