-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
types(runtime-core): Add h
overload to support string|Component|DefineComponent types
#5432
types(runtime-core): Add h
overload to support string|Component|DefineComponent types
#5432
Conversation
…ineComponent types
✔️ Deploy Preview for vue-next-template-explorer ready! 🔨 Explore the source changes: 1bd5fc0 🔍 Inspect the deploy log: https://app.netlify.com/sites/vue-next-template-explorer/deploys/620ba3543acc3d0009d2a576 😎 Browse the preview: https://deploy-preview-5432--vue-next-template-explorer.netlify.app |
✔️ Deploy Preview for vuejs-coverage ready! 🔨 Explore the source changes: 1bd5fc0 🔍 Inspect the deploy log: https://app.netlify.com/sites/vuejs-coverage/deploys/620ba3548c854800075fa449 😎 Browse the preview: https://deploy-preview-5432--vuejs-coverage.netlify.app |
✔️ Deploy Preview for vue-sfc-playground ready! 🔨 Explore the source changes: 1bd5fc0 🔍 Inspect the deploy log: https://app.netlify.com/sites/vue-sfc-playground/deploys/620ba354c2352a0008ca39ed 😎 Browse the preview: https://deploy-preview-5432--vue-sfc-playground.netlify.app/ |
test-dts/h.test-d.ts
Outdated
@@ -149,7 +150,6 @@ describe('h support for generic component type', () => { | |||
function foo(bar: Component) { | |||
h(bar) | |||
h(bar, 'hello') | |||
// @ts-expect-error | |||
h(bar, { id: 'ok' }, 'hello') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After having a thought on this, I don't think having a Prop type check on Component
is good, since if the user is using Component
interface is because he does not know the type, therefor type checking is not needed here.
If we want type checking having a Prop is recommended
declare function renderMyComp<P>(p: Component<P>, props: P): void
renderMyComp({} as Component<{ a: string }>, { a: '' })
Size ReportBundles
Usages
|
fix #5431