Skip to content

Commit

Permalink
Merge pull request #885 from serGlazkov/main
Browse files Browse the repository at this point in the history
fix: useStoryblokState fix case if initialStory changes
  • Loading branch information
fgiuliani authored Jan 8, 2024
2 parents 79f83c6 + 1efda03 commit 63bb2b9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/common/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ export const useStoryblokState: TUseStoryblokState = (
typeof window.storyblokRegisterEvent !== "undefined";

useEffect(() => {
setStory(initialStory);

if (!isBridgeEnabled || !initialStory) return;

registerStoryblokBridge(
Expand Down

0 comments on commit 63bb2b9

Please sign in to comment.