storybook/docs/snippets/common/storybook-addon-change-panel.js.mdx
2020-12-02 15:25:40 +00:00

11 lines
257 B
Plaintext

```js
// /my-addon/src/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>;
};
```