-
Notifications
You must be signed in to change notification settings - Fork 12.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
5.0.2 T extends GenericType<infer InferredType>
no longer resolves as true
#53415
Comments
extends
no longer resolves as true when condition includes an inferred generic argumentT extends Generic type<infer InferredType>
no longer resolves as true
T extends Generic type<infer InferredType>
no longer resolves as trueT extends GenericType<infer InferredType>
no longer resolves as true
We'd need a self-contained repro (i.e. 3-50 lines, none of which import the entirety of Vue) in order to determine if this is an intentional change or not. |
@markglattback Why did you close this? I'm investigating this as well, this broke TS support for Vue in storybook. |
@kasperpeulen whilst the old approach was no longer working with TS 5.0.x, the following has helped: I stumbled across a comment from the author of Volar recommending We're also using Storybook 7 and have no issues with type inference using |
@markglattback Thanks for that! That is really useful. I opened a PR in storybook to use those type helpers: Weird that you don't have issues in storybook, we have multiple users report that it breaks with TS 5.0. |
Bug Report
In previous versions of TypeScript (including 5.0.0-beta), when working with Vue, component prop types could be inferred using the following
ExtractProps
type whereT
is a Vue component:The returned type is now
never
.🔎 Search Terms
infer, generic
🕗 Version & Regression Information
5.0.0-rc
💻 Code
⏯ Playground Link
Working (4.9.5)
Broken (5.0.2)
🙁 Actual behavior
MyComponentProps
isnever
🙂 Expected behavior
MyComponentProps
should be the inferredProps
typeThe text was updated successfully, but these errors were encountered: