storybook/docs/snippets/common/args-usage-with-addons.js.mdx
2021-05-06 21:05:56 +01:00

16 lines
290 B
Plaintext

```js
// your-addon/register.js
import { useArgs } from '@storybook/api';
const [args, updateArgs, resetArgs] = useArgs();
// To update one or more args:
updateArgs({ key: 'value' });
// To reset one (or more) args:
resetArgs((argNames: ['key']));
// To reset all args
resetArgs();
```