Skip to content

Commit

Permalink
Merge pull request #21476 from storybookjs/fix-docs-blank-canvases
Browse files Browse the repository at this point in the history
Docs: Cleanup with Promise instead of setTimeout
  • Loading branch information
JReinhold committed Mar 8, 2023
2 parents a7d76d4 + 1e0cb5e commit bf1dfd4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion code/ui/blocks/src/components/Story.tsx
Expand Up @@ -60,7 +60,7 @@ const InlineStory: FunctionComponent<InlineStoryProps> = (props) => {
return () => {
// It seems like you are supposed to unmount components outside of `useEffect`:
// https://github.com/facebook/react/issues/25675#issuecomment-1363957941
setTimeout(() => cleanup(), 0);
Promise.resolve().then(() => cleanup());
};
}, [autoplay, renderStoryToElement, story]);

Expand Down

0 comments on commit bf1dfd4

Please sign in to comment.