storybook/docs/snippets/common/storybook-addon-change-panel.js.mdx
2022-03-18 10:27:04 +01:00

13 lines
284 B
Plaintext

```js
// /my-addon/src/manager.js
import { useParameter } from '@storybook/api';
const PARAM_KEY = 'myAddon';
const MyPanel = () => {
const value = useParameter(PARAM_KEY, null);
const item = value ? value.data : 'No story parameter defined';
return <div>{item}</div>;
};
```