storybook/docs/snippets/common/args-usage-with-addons.js.mdx
Michael Shilman 4c91362871 cleanup
2020-12-08 19:28:02 +08:00

17 lines
291 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();
```