worked for me: https://github.com/morewings/storybook-addon-theme-provider
preview.ts
:
decorators: [
withThemeProvider(Provider),
///...
],
Provider.tsx
:
export const Provider = <TTheme,>({
children,
theme,
}: {
children?: ReactNode
theme?: TTheme
}) => {
return (
<ThemeProvider theme={theme as DefaultTheme}>
<GlobalStyles />
{children}
</ThemeProvider>
)
}