diff --git a/types/storybook__react/index.d.ts b/types/storybook__react/index.d.ts index 1228124376..dd93b9459b 100644 --- a/types/storybook__react/index.d.ts +++ b/types/storybook__react/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for @storybook/react 3.0 // Project: https://github.com/storybooks/storybook // Definitions by: Joscha Feth +// Anton Izmailov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -9,7 +10,7 @@ import * as React from 'react'; export type Renderable = React.ComponentType | JSX.Element; -export type RenderFunction = () => Renderable; +export type RenderFunction = () => Renderable | Renderable[]; export type StoryDecorator = (story: RenderFunction, context: { kind: string, story: string }) => Renderable | null; diff --git a/types/storybook__react/storybook__react-tests.tsx b/types/storybook__react/storybook__react-tests.tsx index 13cf6aff50..9e7b8f5723 100644 --- a/types/storybook__react/storybook__react-tests.tsx +++ b/types/storybook__react/storybook__react-tests.tsx @@ -6,7 +6,8 @@ const Decorator = (story: RenderFunction) =>
{story()}
; storiesOf('Welcome', module) // local addDecorator .addDecorator(Decorator) - .add('to Storybook', () =>
); + .add('to Storybook', () =>
) + .add('to Storybook as Array', () => [
,
]); // global addDecorator addDecorator(Decorator); @@ -26,6 +27,7 @@ storiesOf('withAnyAddon', module) .addWithSideEffect('custom story', () =>
) .addWithSideEffect('more', () =>
) .add('another story', () =>
) + .add('to Storybook as Array', () => [
,
]) .addWithSideEffect('even more', () =>
); // configure