storybook/docs/_snippets/args-usage-with-addons.md
2024-06-13 17:53:08 +01:00

16 lines
343 B
Markdown

```js filename="my-addon/src/manager.js|ts" renderer="common" language="js"
import { useArgs } from '@storybook/manager-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();
```