storybook/__mocks__/inject-decorator.ts.csf.txt
Shota Fuji d9fad400a1
Source-loader: Support function declaration exports
Added support for named exports with function declaration in
source-loader, in order to fix that the story's source code doesn't show
up in Docs mode's code preview.

The changes in generate-helpers.js is necessary because we can't wrap
named export functions:

```
export function foo() {}

// turns into this if we just wrapped it

export wrapper(function foo() {}) // syntax error!
```
2019-12-07 11:43:45 +00:00

30 lines
611 B
Plaintext

import React from "react";
import { action } from "@storybook/addon-actions";
import { Button } from "@storybook/react/demo";
export default {
title: "Button"
};
export const text = () => (
<Button onClick={action("clicked")}>Hello Button</Button>
);
export const emoji = () => (
<Button onClick={action("clicked")}>
<span role="img" aria-label="so cool">
😀 😎 👍 💯
</span>
</Button>
);
export function emojiFn() {
return (
<Button onClick={action("clicked")}>
<span role="img" aria-label="so cool">
😀 😎 👍 💯
</span>
</Button>
)
};