-
Notifications
You must be signed in to change notification settings - Fork 33
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
Type error when using context API #212
Comments
I think the typing in https://github.com/testing-library/svelte-testing-library/blob/main/types/index.d.ts is wrong. A workaround is to cast the options object to any: |
@sebastianrothe thanks for mentioning a workaround. This is the workaround I am currently using. |
I think this type should be correct: type SvelteComponentOptions<C extends SvelteComponent> = ComponentProps<C> | Pick<ComponentConstructorOptions<ComponentProps<C>>, "anchor" | "props" | "hydrate" | "intro" | "context"> I think But I am not 100% sure. I tested it locally and it worked for me. If desired I can provide a PR for that. |
fix: add missing supported Svelte options to SvelteComponentOptions #212
🎉 This issue has been resolved in version 4.0.4 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Hi,
I got a type error when using the context API.
Component:
Test:
Running
svelte-check
reports this type error:I created a sample repository to reproduce this issue:
https://github.com/Hagendorn/vite-svelte-context-type-issue
To reproduce it checkout the repository and run:
The text was updated successfully, but these errors were encountered: