storybook/docs/snippets/react/list-story-with-subcomponents.ts.mdx
2020-08-10 19:23:38 +01:00

20 lines
369 B
Plaintext

```js
// List.stories.js
import { List, ListProps } from './List';
import { ListItem, ListItemProps } from './ListItem';
export default {
component: List,
subcomponents: [ListItem],
title: 'List',
};
export const Empty = Story<ListProps> = (args) => <List {...args} />;;
export const OneItem = (args) => (
<List {...args}>
<ListItem />
</List>
);
```