You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe
A clear and concise description of the problem. E.g. I'm always frustrated when [...]
I want to use the method setStories provided by const storybookApi = useStorybookApi(); from "@storybook/api" to control what stories show up in the sidebar of my storybook.
However, the input of setStories is of type StoriesRaw as seen in the implementation below:
setStories: async (input, error) => {
// Now create storiesHash by reordering the above by group
const hash = transformStoriesRawToStoriesHash(input, {
provider,
});
await store.setState({
storiesHash: hash,
storiesConfigured: true,
storiesFailed: error,
});
}
This results in an error when my input is of type StoriesHash and the function attempts to convert it to StoriesHash.
From the api, i don't see any method that allows me to retrieve stories in the type of StoriesRaw and this renders me helpless in calling the above method.
Describe the solution you'd like
What would you like to see added to Storybook to solve problem?
I would like to see another function being created for setStories in which in the input is of type StoriesHash instead of StoriesRaw and the implementation skips this method call transformStoriesRawToStoriesHash.
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!
We’re cleaning house! Storybook has changed a lot since this issue was created and we don’t know if it’s still valid. Please open a new issue referencing this one if this is still relevant in SB 7.x.
Is your feature request related to a problem? Please describe
A clear and concise description of the problem. E.g. I'm always frustrated when [...]
I want to use the method
setStories
provided byconst storybookApi = useStorybookApi();
from"@storybook/api"
to control what stories show up in the sidebar of my storybook.However, the input of
setStories
is of type StoriesRaw as seen in the implementation below:This results in an error when my input is of type StoriesHash and the function attempts to convert it to StoriesHash.
From the api, i don't see any method that allows me to retrieve stories in the type of StoriesRaw and this renders me helpless in calling the above method.
Reference: https://github.com/storybookjs/storybook/blob/main/lib/api/src/modules/stories.ts#:~:text=%7D%2C-,setStories%3A,-async%20(input%2C%20error
Describe the solution you'd like
What would you like to see added to Storybook to solve problem?
I would like to see another function being created for
setStories
in which in the input is of typeStoriesHash
instead ofStoriesRaw
and the implementation skips this method calltransformStoriesRawToStoriesHash
.Describe alternatives you've considered
Any alternative solutions or features you've considered.
Are you able to assist to bring the feature to reality?
no | yes, I can...
Yes. I believe the fix is just to add another method below. Correct me if i am wrong?
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: