-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
[Bug]: setProjectAnnotations typescript error when decorators has withThemeFromJSXProvider #25042
Comments
Hey @aarjithn 😁 I'm just getting back from holidays so I just need a few days to get to this. Stay tuned 📻 |
I'm also having the same issue. Not sure if my info is helpful: System: |
@integrayshaun do you have an update on this? |
Hey everyone! This seems to be an issue because the function from addon-themes uses a Typescript generic that should be specified once you use it, e.g. import { withThemeFromJSXProvider } from '@storybook/addon-themes';
import { ReactRenderer } from '@storybook/react';
export const decorators = [
withThemeFromJSXProvider<ReactRenderer>({ // <-- You have to specify the ReactRenderer
themes: {
light: {},
dark: {},
},
defaultTheme: 'light',
}),
]; If you do that, the problem should be gone. Here's a repro. Regardless, we should probably improve our documentation to include this! |
Thank you! confirmed adding the generic fixed the issue. |
Describe the bug
Storybook
preview.tsx
is setup like thisand then in
test-setup.ts
Throws below error
To Reproduce
No response
System
Additional context
No response
The text was updated successfully, but these errors were encountered: