#Possible to update component state and story control args?
10 messages · Page 1 of 1 (latest)
It is, actually! At least if you're using React, you can use the useArgs hook from @storybook/addons (or @storybook/client-api if you're on v6.x if I'm not mistaken).
I'm not sure it's doable if you're not using React though..
Oof I use vue 2. I'll look into it though.
I think this issue might be helpful to you, it looks like it's doable in vue3 at least, so maybe also vue2? I'm not a vue expert at all.
https://github.com/storybookjs/storybook/issues/18358
Describe the bug The last section of the args docs for yue are incorrect because the shown code doesn't work for vue as useArgsis a react specific hook: https://storybook.js.org/docs/vue/wr...
@plain plume Interesting, so I have to do it with the client api context then.
One last question:
In Storybook 6+, we pass the args as the first argument to the story function. The second argument is the “context”, which includes story parameters, globals, argTypes, and other information.
"and other information" do you have details on what this other information is? Where in the docs could I find all the details to the second object sent to a story function?
v6 or v7?
v6
I actually don't know. @heavy basalt do you know if we have documentation/typings for what the story context contains?