storybook/docs/snippets/common/storybook-addon-change-panel.js.mdx
2020-08-11 02:51:40 +01:00

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>;
};
```