mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-06 07:21:16 +08:00
11 lines
263 B
Plaintext
11 lines
263 B
Plaintext
```js
|
|
// .storybook/my-addon/register.js
|
|
|
|
import { useParameter } from '@storybook/api';
|
|
const PARAM_KEY = 'myAddon';
|
|
const MyPanel = () => {
|
|
const value = useParameter(PARAM_KEY, null);
|
|
const item = value ? value.data : '';
|
|
return <div>{item}</div>;
|
|
};
|
|
``` |