mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-06 01:11:06 +08:00
16 lines
289 B
Plaintext
16 lines
289 B
Plaintext
```js
|
|
// your-addon/manager.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();
|
|
``` |