defineProps doesn't support typing props with "Extract", a native TypeScript's feature. #7337
Labels
🔨 p3-minor-bug
Priority 3: this fixes a bug, but is an edge case that only affects very specific usage.
has PR
A pull request has already been submitted to solve the issue
🐞 bug
Something isn't working
scope: compiler
Vue version
3.2.44
Link to minimal reproduction
https://sfc.vuejs.org/#eNqVUs1u2zAMfhVCF29AIt8910DaDeiAASuwwy66uDbtKLUpQWKSDZnffZTdom566sUWSX0/+qSL2nmvT0dUhSoZRz/UjJUhgPLe3rnRO0Ji6GyIvB2QGcONUTujIGLjqH3t3RpVlfkKJCxlvqKUMjbBehYoHz0MNfWC4yhAQ1ZQgeGNaHAjZHrNmZxmiXdhEpzaqAW6HWuvD9GRnOSSDmCeB8JfwNxJPSFItVF7Zh+LPI9dk1gPUbvQ57LS4UhsR9QYx+1jcOeIQYiNShSToUkkryxdhWe4bO2purdlnv5zmmlxucw5/pgjm6Z30yXS6/EHQuS/HmHBww1kuwz+QXY7f++yLwndYmcJH4LzsZRMDK8cFS/QPIffLjxFuXZCnQyunRXw7Q+HuuFyqTdJokqgrw4jkGM4C1rDQ7DEEc51IEs9WAIhiW7AAr7TqR5sC16MFDDbbvbYPEFX2wFb6FyYZ3JPa2mjtIh7bFj2/Hw8yGIDvQj+YtHq4Wx5D8J8RAHKgxTvU/Xp8+rBqOk/mqwIHQ==
Steps to reproduce
npm create vue@3
command.\src\components\HiComponent.vue
with the following code:\src\App.vue
file with the following code:npm run dev
command.http://localhost:5173/
).What is expected?
App runs without any warnings.
What is actually happening?
The following warning appears in console:
System Info
Any additional comments?
TypeScript's
Extract
suppose to return a new type, which is a subset of type passed to Extract as the first generic parameter. It feels like for some reason defineProps doesn't treat it correctly.The text was updated successfully, but these errors were encountered: