Contentful Rich Text Field within Gatsby
Oct 19, 2021
If you are looking for information about rendering contentful rich-text into Gatsby, you are in the right place. In 2020, Contentful changed rich text query from JSON to raw.
Here’s what I did:
- Created a rich text component `RichText.tsx`
2. The query looks like this: (for reference only)
termsAndConditions {
raw
}
3. Componet is called as follows:
<RichText data={termsAndConditions} />