From e9401d205dab42121d175f5757d2f0ae886c112e Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Mon, 6 May 2019 19:32:15 +0200 Subject: [PATCH] FIX wrapper not always being defined --- app/svelte/src/client/preview/render.js | 4 ++-- .../svelte-kitchen-sink/src/stories/addon-centered.stories.js | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/svelte/src/client/preview/render.js b/app/svelte/src/client/preview/render.js index b42a4676dc0..59b818f294b 100644 --- a/app/svelte/src/client/preview/render.js +++ b/app/svelte/src/client/preview/render.js @@ -61,8 +61,8 @@ export default function render({ } = storyFn(); cleanUpPreviousStory(); - const DefaultCompatComponent = Component.default || Component; - const DefaultCompatWrapper = Wrapper.default || Wrapper; + const DefaultCompatComponent = Component ? Component.default || Component : undefined; + const DefaultCompatWrapper = Wrapper ? Wrapper.default || Wrapper : undefined; if (!DefaultCompatComponent) { showError({ diff --git a/examples/svelte-kitchen-sink/src/stories/addon-centered.stories.js b/examples/svelte-kitchen-sink/src/stories/addon-centered.stories.js index d350f4e3f09..ee7985889f1 100644 --- a/examples/svelte-kitchen-sink/src/stories/addon-centered.stories.js +++ b/examples/svelte-kitchen-sink/src/stories/addon-centered.stories.js @@ -4,6 +4,8 @@ import { action } from '@storybook/addon-actions'; import Button from '../components/Button.svelte'; +console.log({ Button }); + storiesOf('Addon|Centered', module) .addDecorator(Centered) .add('rounded', () => ({