storybook/docs/snippets/html/list-story-reuse-data.js.mdx

23 lines
518 B
Plaintext

```js
// List.stories.js
import { createList } from './List';
import { createListItem } from './ListItem';
// 👇 We're importing the necessary stories from ListItem
import { Selected, Unselected } from './ListItem.stories';
export default {
title: 'List',
};
export const ManyItems = (args) => {
const list = createList(args);
list.appendChild(createListItem(Selected.args));
list.appendChild(createListItem(Unselected.args));
list.appendChild(createListItem(Unselected.args));
return list;
};
```