Strapi includes a rich text (blocks) field type which when retrieved with the REST API or GraphQL, returns an array of objects. The objects are "blocks" which have a type and inner content, but rendering them is not that trivial. To render them in a React environment, the Strapi team have built the block-react-renderer libary which provides an excellent React plugin. In this video I will demonstrate how to use the Block React Renderer plugin to render the content of a blog post type in a Next.js application.
strapi/blocks-react-renderer - GitHub:
https://github.com/strapi/blocks-reac...
@tailwindcss/typography - TailwindCSS Docs:
https://tailwindcss.com/docs/typograp...
Contents:
0:00 Introduction
0:34 Create a Blogs Content Type
4:10 Retrieve the Blog with the REST API
5:52 The Blocks React Renderer Libary
6:42 Create a Next.js App
8:43 Install and Use the Blocks React Renderer
10:30 Fetch the Blog Post from Strapi
11:57 Render the Blog Post Content
12:39 Using the Tailwind Typography Plugin
14:12 Conclusion
Social Media:
Email: [email protected]
Twitter: Β Β /Β nikelazΒ Β
LinkedIn: Β Β /Β nikola-lazarovΒ Β
#strapi #course #richText #headless #cms
Watch video Render a Rich Text (Blocks) Field in React π Strapi Course #9 online without registration, duration hours minute second in high quality. This video was added by user NL Tech 27 January 2024, don't forget to share it with your friends and acquaintances, it has been viewed on our site 2,976 once and liked it 75 people.