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
Смотрите видео Render a Rich Text (Blocks) Field in React 🚀 Strapi Course #9 онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь NL Tech 27 Январь 2024, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 2,976 раз и оно понравилось 75 людям.