Not rendering html tags (react)

Hello all

I'm displaying some content in a basic react app but for a strange reason I can only get a raw content missing the html tags.

This is the content that I have in Prismic:


And this is my code:

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

How should I render this properly?

Hey @Rola, can you show me the setup for the Rich Text field (in the Custom Type) and the content you're adding to the document? That can help us reproduce the use case on our end. Also, which technology are you using to query the data?

Hi @Pau

This is the code of that page:

const SinglePage = ({ match }) => {
    const [prismicDoc, setPrismicDoc] = useState(null);
    const [notFound, toggleNotFound] = useState(false);
    const uid = match.params.uid;
    // Get the blog post document from Prismic
    useEffect(() => {
        const fetchPrismicData = async () => {
            try {
                const doc = await client.getByUID('paginas', uid);

                if (doc) {
                } else {
                    console.warn('Blog post document was not found. Make sure it exists in your Prismic repository');
            } catch (error) {
    }, [uid]);
    // Return the page if a document was retrieved from Prismic
    if (prismicDoc) {
        const title =
   !== 0 ?
                RichText.asText( :
        return (
                    <div key={}>
                        <h1> {prismicDoc?.data?.titulo[0]?.text}</h1>
                        <img src={prismicDoc?.data?.main_image?.url} alt=""/>
                           {prismicDoc?.data?.contenido?.map(x => x?.text || null)}


    } else if (notFound) {
        return <NotFound />;
  • What are the tags that you're expecting to see in the titulo Rich Text field?
  • What is the URL of your repository?