mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-07 00:21:24 +08:00
18 lines
337 B
Plaintext
18 lines
337 B
Plaintext
```js
|
|
// /my-addon/register.js
|
|
|
|
import React from 'react';
|
|
|
|
import { useParameter } from '@storybook/api';
|
|
|
|
export const Panel = () => {
|
|
const value = useParameter('parameter-key', 'default value');
|
|
|
|
return (
|
|
<div>
|
|
for the currently selected story, the parameter for "parameter-key" is:
|
|
{value}
|
|
</div>
|
|
);
|
|
};
|
|
``` |