forked from storybookjs/storybook
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes storybookjs#17839 - handle suspense in story function
If a story function triggers Suspense by throwing a promise liike some third party hooks do, the story will fail to render because the useEffect is skipped the first time and then run the second time, resulting in the "Rendered more hooks than during the previous render." error This runs the story function after the useEffect hook so the same number of hooks are run whether it triggers suspense or not, and in keeping with the guidelines on not conditionally running hooks
- Loading branch information
Showing
2 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters