storybook/docs/snippets/react/list-story-reuse-data.js.mdx
2021-09-03 23:31:04 +01:00

26 lines
515 B
Plaintext

```js
// List.stories.js | List.stories.jsx
import React from 'react';
import { List } from './List';
import { ListItem } from './ListItem';
//👇 We're importing the necessary stories from ListItem
import { Selected, Unselected } from './ListItem.stories';
export default {
component: List,
};
export const ManyItems = {
render: (args) => (
<List {...args}>
<ListItem {...Selected.args} />
<ListItem {...Unselected.args} />
<ListItem {...Unselected.args} />
</List>
),
};
```