From 5177510e01fb9098a75516d6f62c2a2cdfcdc750 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Sun, 7 Jul 2019 23:41:12 +0200 Subject: [PATCH 1/2] FIX docs-mode by using storyFn instead of getDecorated --- addons/docs/src/blocks/Story.tsx | 2 +- lib/client-api/src/story_store.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/docs/src/blocks/Story.tsx b/addons/docs/src/blocks/Story.tsx index 888d379c6ef4..6940fbe192b1 100644 --- a/addons/docs/src/blocks/Story.tsx +++ b/addons/docs/src/blocks/Story.tsx @@ -49,7 +49,7 @@ export const getStoryProps = ( return { inline: typeof inline === 'boolean' ? inline : inlineStories, id: previewId, - storyFn: data && data.getDecorated(), + storyFn: data && data.storyFn, height: height || iframeHeight, title: data && data.name, }; diff --git a/lib/client-api/src/story_store.ts b/lib/client-api/src/story_store.ts index d87183ef216a..915d82b794a3 100644 --- a/lib/client-api/src/story_store.ts +++ b/lib/client-api/src/story_store.ts @@ -188,7 +188,7 @@ export default class StoryStore extends EventEmitter { applyDecorators(getOriginal(), getDecorators()) ); - const storyFn: StoryFn = (p: StoryContext) => + const storyFn: StoryFn = (p: object) => getDecorated()({ ...identification, parameters: { ...parameters, ...p } }); _data[id] = { From c008552ebff3ce4671e946a5f6683b4ca3b96962 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Sun, 7 Jul 2019 23:59:33 +0200 Subject: [PATCH 2/2] REMOVED unused import (type) --- lib/client-api/src/story_store.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/client-api/src/story_store.ts b/lib/client-api/src/story_store.ts index 915d82b794a3..b8468d9872f6 100644 --- a/lib/client-api/src/story_store.ts +++ b/lib/client-api/src/story_store.ts @@ -7,7 +7,7 @@ import { stripIndents } from 'common-tags'; import { Channel } from '@storybook/channels'; import Events from '@storybook/core-events'; import { logger } from '@storybook/client-logger'; -import { StoryContext, StoryFn, Parameters } from '@storybook/addons'; +import { StoryFn, Parameters } from '@storybook/addons'; import { DecoratorFunction, LegacyData,