mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 07:01:53 +08:00
20 lines
464 B
Plaintext
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>
|
|
)}/>
|
|
``` |