-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
mount
return value incorrectly typed?
#14401
Comments
What you try to do doesn't sound accurate. The |
Okay... how would I type just the exports of a component? |
That works in the very specific scenario I used above, but I need the type of the component exports for another use case. I think I found a solution though: type ComponentExports<T extends Component> =
T extends Component<any, infer Exports> ? Exports : unknown thanks for the hint! |
Closing because the problem has been solved and there's no Svelte issue here. |
Describe the bug
It appears that
tsc
doesn't accept the line:with a type error. The following, however, works:
Reproduction
The issue somehow cannot be reproduce in the svelte playground (attempt here), so I've created a repo showcasing the issue: https://github.com/Nearoo/svelte-mount-issue
If you prefer to recreate locally, do:
npm create vite@latest -> Svelte -> TypeScript
App.svelte
andMyComponent.svelte
Run
npm run check
, and you'll get the following output:Logs
No response
System Info
Just posting
package.json
:Severity
annoyance
The text was updated successfully, but these errors were encountered: