storybook/docs/snippets/react/component-story-with-custom-render-function.mdx.mdx
2021-10-19 18:19:00 +01:00

20 lines
464 B
Plaintext

```md
<!-- MyComponent.stories.mdx -->
import { Meta, Story } from 'storybook/addon-docs';
import { MyComponent } from './MyComponent';
<Meta title="CustomRenderFunction" component= {MyComponent} />
<!-- This story uses a render function to fully control how the component renders. -->
<Story
name="ExampleWithRenderFunction"
render={()=>(
<div>
<h1>I'm a component with a custom render function</h1>
<MyComponent />
</div>
)}/>
```