-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Composition - switching stories within a composed storybook shows spinners and reloads #21499
Comments
Note that this also occurs in 6.5 -- this has been an issue for some time; it happens due to changing the I would love to fix it but not sure about the riskiness of changing it at this stage @ndelangen @shilman. |
So the simplest fix I can find is to really juice the reactivity of the const filteredRefs = Object.values(refs).filter((r) => {
if (r.indexError) {
return false;
}
if (r.type === 'auto-inject') {
return true;
}
if (entry && r.id === entry.refId) {
return true;
}
return false;
});
useEffect(() => {
const newFrames = filteredRefs.reduce((acc, r) => {
return {
...acc,
[`storybook-ref-${r.id}`]: `${r.url}/iframe.html?id=${storyId}&viewMode=${viewMode}&refId=${r.id}${stringifiedQueryParams}`,
};
}, frames);
setFrames(newFrames);
}, [filteredRefs.map((r) => r.id).join('-')]); |
@tmeasday WDYT about:
Where we ensure the frame isn't recreated every time? |
Hmmm testing the above and it still refreshes |
OK, found a fix, I'll submit a PR. |
Yo-ho-ho!! I just released https://github.com/storybookjs/storybook/releases/tag/v7.0.0-rc.8 containing PR #21713 that references this issue. Upgrade today to the
|
Describe the bug
Issue extracted from: #21352
@yannbf reported some of these in QA as well.
When visiting composed stories, the preview completely reloads after a second.
This is composing the SB Design system.
Here's another example showing the difference between a composed storybook and the uncomposed:
Changing controls to a composed Storybook seems to reload the entire preview.
To Reproduce
code/ui/.storybook/main.ts
file.System
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: