Open hwookim opened 1 month ago
@ndelangen Any ideas?
Is there any way to ensure that
preview.js
is called beforemanager.js
?
Unfortunately, no.
This is due to the fact that parameters are dynamic, and stories are loaded async; the manager can only know about the parameters on a story, after it's been loaded.
@ndelangen Is there any API to know if a parameter has been loaded? It's hard to know by the presence or absence of a value, since the user can send an empty value.
No, there's currently no way to distinguish between those scenarios.
Describe the bug
The
useParameter
API is not working on initial load.I'm implementing and managing a
storybook-addon-cookie
. My addon usesuseParameter
to read the cookie values entered by the user inside the story and display them in the panel.However, since migrating to storybook version 8, when I access the parameter via
useParameter
, I get an empty value on initial load. When I useconsole.log
topreview
andPanel
, it appears to be getting an empty value untilpreview
is called.Is there any way to ensure that
preview.js
is called beforemanager.js
?Reproduction link
https://github.com/hwookim/storybook-addon-cookie
Reproduction steps
No response
System
The package pretty much follows the settings in addon-kit.
Additional context
No response