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

13 lines
237 B
Plaintext

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