@storybook/html: add support for stories generated by dom elements (#35947)

This commit is contained in:
Christian Murphy
2019-06-04 11:22:05 -07:00
committed by Andrew Casey
parent bf0310e305
commit 6c9328fbf3
2 changed files with 6 additions and 1 deletions
+1 -1
View File
@@ -6,7 +6,7 @@
/// <reference types="webpack-env" />
export type RenderFunction = () => string | string[];
export type RenderFunction = () => string | string[] | HTMLElement;
export interface DecoratorParameters {
[key: string]: any;
@@ -33,6 +33,11 @@ storiesOf<AnyAddon>('withAnyAddon', module)
.addWithSideEffect('more', () => "<div></div>")
.add('another story', () => "<div></div>")
.add('to Storybook as Array', () => ["<div></div>", "<div></div>"])
.add('storybook with dom', () => {
const button = document.createElement('button');
button.innerText = '😀 😎 👍 💯';
return button;
})
.add('and a story with additional parameters', () => "<div></div>", parameters)
.addWithSideEffect('even more', () => "<div></div>");