Closed mimbimbo closed 4 years ago
Hi @mimbimbo, Here your video answer https://youtu.be/vKIyhp3PvWw Here is the repo with all the code https://github.com/Khaledgarbaya/rich-text-gatsby
Cheers, Khaled
right now it is not JSON, but it uses raw, I am having problems with references... can you look at It ?
Hi there - Here's my question: How do I properly display Rich Text in Gatsby? I'm able to pull the Rich Text from Contentful with my specific query (for example:
allContentfulBlogPost { edges { node { childContentfulBlogPostBodyRichTextNode { json } } } }
However, when I try to display this in my Gatsby page, none of the formatting is there. I was using this to grab the content
import { documentToReactComponents } from "@contentful/rich-text-react-renderer"
and then:<div>{documentToReactComponents(props.data.allContentfulBlogPost.edges[1].node.childContentfulBlogPostBodyRichTextNode.json)}</div>