From 0f6a8dfa725e50fb8711a661a2285eb9b67da3a0 Mon Sep 17 00:00:00 2001 From: jbpenrath Date: Tue, 7 Jan 2025 18:41:39 +0100 Subject: [PATCH] =?UTF-8?q?=E2=AC=86=EF=B8=8F(react)=20upgrade=20storybook?= =?UTF-8?q?=20to=208.4.x?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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`. --- packages/react/.storybook/preview.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/react/.storybook/preview.tsx b/packages/react/.storybook/preview.tsx index bad410976..265be3284 100644 --- a/packages/react/.storybook/preview.tsx +++ b/packages/react/.storybook/preview.tsx @@ -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 ; @@ -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 => ({