Skip to content

Commit

Permalink
⬆️(react) upgrade storybook to 8.4.x
Browse files Browse the repository at this point in the history
With the latest version of storybook, our documentation were broken as
we were trying to access to a property from an object that does not
exist anymore. In fact, in the preview context, a property `globals`
has been renamed `userGlobals`.
  • Loading branch information
jbpenrath committed Jan 8, 2025
1 parent 86815cf commit 0f6a8df
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/react/.storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import { Preview } from '@storybook/react';
import { DocsContainer } from '@storybook/blocks';

import { CunninghamProvider } from ':/components/Provider';
import { BACKGROUND_COLOR_TO_THEME, getThemeFromGlobals, themes } from './themes';
import {BACKGROUND_COLOR_TO_THEME, getThemeFromGlobals, Themes, themes} from './themes';

export const DocsWithTheme = (props, context) => {
const theme = getThemeFromGlobals(props.context.store.globals.globals);
const theme = getThemeFromGlobals(props.context.store.userGlobals.globals);
return <CunninghamProvider theme={theme}>
<DocsContainer {...props} theme={themes[theme]} />
</CunninghamProvider>;
Expand All @@ -23,7 +23,6 @@ const preview: Preview = {
),
],
parameters: {
actions: { argTypesRegex: '^on[A-Z].*' },
backgrounds: {
default: null,
values: Object.entries(BACKGROUND_COLOR_TO_THEME).map(value => ({
Expand Down

0 comments on commit 0f6a8df

Please sign in to comment.