Announcing @storyblok/react
Storyblok is the first headless CMS that works for developers & marketers alike.
Starting from our brand new @storyblok/js, we announced @storyblok/svelte about 1 week and a few days ago.
Today, we'd like to announce another hot🔥 SDK - @storyblok/react 🥳
We reviewed how React & Storyblok projects are handled and took care of the pain points to deliver less complication.
Let us know how's your DX with our new @storyblok/react SDK!
Special thanks to Alex, Facundo, and Josefine for their hard & awesome work 🙏
You'll need TL;DR? You can jump directly to the LIVE DEMO in Stackblitz right away.
Usage
First things first, install @storyblok/react by running the command below.
i.e. You can do that in pages/_app.js if you use @storyblok/react for your Next.js projects, or in index.js file in React apps.
If you would like to use the Storyblok API Client, you can add apiPlugin
.
Did you realize something?😎
You don't have to handle conditionally returning components by yourself anymore!
We took care of all and you just need to add all your components to the components object in the storyblokInit
function, and that's it!
Query Storyblok API and listen for Visual Editor changes
You can use the convenient useStoryblok(slug, apiOptions)
hook to get the story from the Storyblok CDN API, and automatically use Storyblok Bridge to listen for the Visual Editor live changes.
TL;DR: Play with the Next.js https://stackblitz.com/edit/react-next-sdk-demo[](https://stackblitz.com/edit/react-next-sdk-demo)
Resource | Link |
---|---|
@storyblok/react docs | https://www.npmjs.com/package/@storyblok/react |
Storyblok Learning Hub | https://www.storyblok.com/docs |
DEV.to announcement blog post | https://dev.to/storyblok/announcing-storyblokreact-pgn |