mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-05 16:11:33 +08:00
13 lines
284 B
Plaintext
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>;
|
|
};
|
|
``` |