Skip to content

Commit

Permalink
fix: useStoryblokBridge without id
Browse files Browse the repository at this point in the history
  • Loading branch information
fgiuliani committed Mar 16, 2022
1 parent 3c10221 commit 95f5d6b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ export const useStoryblokBridge = (id, cb, options = {}) => {
return;
}

if (!id) {
console.warn("Story ID is not defined. Please provide a valid ID.");
return;
}

window.storyblokRegisterEvent(() => {
const sbBridge = new window.StoryblokBridge(options);

Expand Down

0 comments on commit 95f5d6b

Please sign in to comment.