storybook/docs/snippets/common/storybook-addons-api-usestorybookstate.js.mdx

13 lines
243 B
Plaintext

```js
// /my-addon/register.js
import React from 'react';
import { useStorybookState } from '@storybook/api';
export const Panel = () => {
const state = useStorybookState();
return <div>do something with storybook's state</div>;
};
```