Contentful Rich Text Field within Gatsby

Vanessa M.
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:

  1. 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} />

--

--

Vanessa M.

I’m a Freelance Full Stack Engineer, traveler, and amateur photographer.