mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-06 07:21:16 +08:00
17 lines
279 B
Plaintext
17 lines
279 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(['key']);
|
|
|
|
// To reset all args
|
|
resetArgs();
|
|
```
|