-
Notifications
You must be signed in to change notification settings - Fork 43
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Hi there! Thanks for the add-on!
I'm running into a problem with a story that demos a loading state:
- The Loading story applies a handler with
ctx.delay('infinite')
. This story works great!- Specifically, this is a graphql handler for a request from Apollo Client.
- But when I load that story and then switch to another story in the same file, that second story also appears as loading forever. The pending request from the first story remains in the network tab, and no new request appears from the second story.
Any help debugging / solving this would be appreciated! Please let me know if additional info would be helpful.
It's a bit hard to debug this / pinpoint what part of the stack may be responsible for not ending the pending request and initiating a new one when switching from the Loading story to the next one. Apologies if I'm barking up the wrong tree.
In the meanwhile, since refreshing the browser tab on the second (non-loading) story allows that story to load correctly, I've worked around this by using a decorator that reloads the iframe when leaving the Loading story. This is the only workaround I've found that helps.
// Yuck...
Loading.decorators = [
(Story) => {
useEffect(() => {
return () => window.location.reload();
}, []);
return <Story />;
},
];
blakek, mshick, tomgardiner-retailx, impaler, olicarter and 36 morechad-levesque, impaler, JonasMazza, dziamid and slugmandrew
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working