From b00b58c0d261e10aadc38e9fa721a7d7705e8785 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Fri, 27 Oct 2023 23:59:46 +0200 Subject: [PATCH] Merge pull request #24596 from storybookjs/24351-bug-error-when-switching-themes-addon-themes Addon-themes: Fix globals not being set when using absolute path (cherry picked from commit 010fc1362d99b95162559a76a4fecc0461e1f902) --- CODEOWNERS | 1 + code/addons/themes/src/preview.tsx | 10 +++------- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/CODEOWNERS b/CODEOWNERS index de427497aba2..b0e8ad0575d4 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -29,6 +29,7 @@ /code/addons/storyshots-core/ @ndelangen /code/addons/storyshots-puppeteer/ @ndelangen /code/addons/storysource/ @ndelangen +/code/addons/themes/ @JReinhold @Integrayshaun /code/addons/toolbars/ @ndelangen @JReinhold /code/addons/viewport/ @yannbf @ndelangen diff --git a/code/addons/themes/src/preview.tsx b/code/addons/themes/src/preview.tsx index 88b41773e9db..1ee39be54ed0 100644 --- a/code/addons/themes/src/preview.tsx +++ b/code/addons/themes/src/preview.tsx @@ -1,11 +1,7 @@ import type { Renderer, ProjectAnnotations } from '@storybook/types'; import { GLOBAL_KEY } from './constants'; -const preview: ProjectAnnotations = { - globals: { - // Required to make sure SB picks this up from URL params - [GLOBAL_KEY]: '', - }, +export const globals: ProjectAnnotations['globals'] = { + // Required to make sure SB picks this up from URL params + [GLOBAL_KEY]: '', }; - -export default preview;