mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-04 21:01:08 +08:00
ensure storyFn() result is computed at initial render
This commit is contained in:
parent
55eff3ba38
commit
7cfe0dbb8d
@ -8,14 +8,7 @@
|
||||
export let showError;
|
||||
export let storyContext;
|
||||
|
||||
let Component;
|
||||
let props = {};
|
||||
let on;
|
||||
let Wrapper;
|
||||
let WrapperData = {};
|
||||
|
||||
// reactive, re-render on storyFn change
|
||||
$: ({
|
||||
let {
|
||||
/** @type {SvelteComponent} */
|
||||
Component,
|
||||
/** @type {any} */
|
||||
@ -24,7 +17,10 @@
|
||||
on,
|
||||
Wrapper,
|
||||
WrapperData = {},
|
||||
} = storyFn());
|
||||
} = storyFn();
|
||||
|
||||
// reactive, re-render on storyFn change
|
||||
$: ({ Component, props = {}, on, Wrapper, WrapperData = {} } = storyFn());
|
||||
|
||||
const eventsFromArgTypes = Object.fromEntries(
|
||||
Object.entries(storyContext.argTypes)
|
||||
|
Loading…
x
Reference in New Issue
Block a user