Skip to content
This repository was archived by the owner on Jun 19, 2025. It is now read-only.

Commit 33f6fd4

Browse files
authored
Merge pull request #132 from storyblok/use-storyblok-bridge-not-hook
fix: useStoryblokBridge is not a hook
2 parents d4f9612 + bcb1922 commit 33f6fd4

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ const { data } = await storyblokApi.get("cdn/stories", { version: "draft" });
9797
9898
#### 2. Listen to Storyblok Visual Editor events
9999

100-
Use `useStoryblokBridge` to get the new story every time is triggered a `change` event from the Visual Editor. You need to pass the story id as first param, and a callback function as second param to update the new story:
100+
Use `useStoryblokBridge` or `registerStoryblokBridge` to get the new story every time is triggered a `change` event from the Visual Editor. You need to pass the story id as first param, and a callback function as second param to update the new story:
101101

102102
```js
103103
import { storyblokInit, apiPlugin, useStoryblokBridge } from "@storyblok/js";
@@ -180,7 +180,7 @@ const { storyblokApi } = storyblokInit({
180180
});
181181
```
182182

183-
If you don't use `useStoryblokBridge`, you have still access to the raw `window.StoryblokBridge`:
183+
If you don't use `useStoryblokBridge` or `registerStoryblokBridge`, you have still access to the raw `window.StoryblokBridge`:
184184

185185
```js
186186
const sbBridge = new window.StoryblokBridge(options);

lib/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ export const useStoryblokBridge = <
5252
});
5353
};
5454

55+
export { useStoryblokBridge as registerStoryblokBridge };
56+
5557
export { default as apiPlugin } from "./modules/api";
5658
export { default as storyblokEditable } from "./modules/editable";
5759

0 commit comments

Comments
 (0)