From 95f5d6b0ff587c08f66915b54cd2b355ca958903 Mon Sep 17 00:00:00 2001 From: Facundo Giuliani Date: Wed, 16 Mar 2022 19:15:21 -0300 Subject: [PATCH] fix: useStoryblokBridge without id --- lib/index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/index.js b/lib/index.js index c4d5793d..f9814d0b 100644 --- a/lib/index.js +++ b/lib/index.js @@ -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);