storybook/docs/snippets/react/my-component-story-with-nonstory.js.mdx
2020-10-07 12:23:34 +08:00

19 lines
519 B
Plaintext

```js
// MyComponent.stories.js
import React from 'react';
import MyComponent from './MyComponent';
import someData from './data.json';
export default {
title: 'MyComponent',
component: MyComponent,
includeStories: ['SimpleStory', 'ComplexStory']
}
export const simpleData = { foo: 1, bar: 'baz' };
export const complexData = { foo: 1, { bar: 'baz', baz: someData }};
export const SimpleStory = () => <MyComponent data={simpleData} />;
export const ComplexStory = () => <MyComponent data={complexData} />;
```