Subscribe on changes!

If defineProps's type uses vue's `Component` it will result in an incorrect type after compilation

avatar
Dec 1st 2023

Vue version

latest

Link to minimal reproduction

https://play.vuejs.org/#__DEV__eNp9kU1PwzAMhv+KlctAmjah3UYpArQDHGCCHXOpWrfLSJ0oSbeiqv8dp9U+DrCb7fd1/NjpxJO1s32DYikSnztlA3gMjQWdUfUgRfBSpJJUbY0L0MGL4YiQAvRQOlPDhJsnkgosFeHaGeuTThJk/nF5Nt9L6tObW0nJfBzCT3ISsLY6C8gZQLK9Szc/FuHgDFXJnNPov/CIKePkhkpVzXbeEDPHUSBFzoOURvdhgzLEyEsYlKhlWpvD21ALrsHpsZ5vMf/+o77zbaxJsXbo0e1RipMWMldhGOXV1zu2HJ/E2hSNZvcV8RO90U1kHG3PDRWMfeEbaF+HayuqNn7VBiR/XCqCRmc/+KXg28cb/7f6GXcxWwx9/A+i/wXqeKcQ

Steps to reproduce

Look at the js panel, you can see the as prop's type is null

What is expected?

The type is correct or the prop contains skipCheck: true

What is actually happening?

type is null

System Info

No response

Any additional comments?

For more info refer https://github.com/radix-vue/shadcn-vue/issues/187

avatar
Dec 1st 2023

Looks to be right to me, because component can be many things, the generated runtime type is null, that's expected and intended.

The type is correct or the prop contains skipCheck: true Not sure what you mean by this, where would skipCheck come from?

avatar
Dec 1st 2023

Sorry I still don't understand what's the issue, null should not have any check done.

avatar
Dec 1st 2023

Sorry I still don't understand what's the issue, null should not have any check done.

Thank you I understand. At first I thought the null type was incorrect. cc @zernonia

avatar
Dec 1st 2023

Just to confirm, here's an example of null without any warning or error

playground