1 year ago

#200979

test-img

Rolanda

Using RichText in a map in React

Thank you so, so much for your time looking at this

I'm using React and Prismic I'm trying to apply RichText (https://prismic.io/docs/technologies/rendering-the-rich-text-and-title-field-reactjs) to render the text but do not work on map.

My guess is that I'm loosing some logic here but I can't understand what is This show the content without rendering:

{prismicDoc?.data?.contenido?.map(x => x?.text || null)}

This show me an error:

{RichText.render(prismicDoc?.data?.contenido?.map(x => x?.text || null))}

The error is TypeError: Cannot read properties of undefined (reading 'map')

Could you please let me know what I'm doing wrong?

Thanks Laura

javascript

reactjs

prismic.io

0 Answers

Your Answer

Accepted video resources