Next.js Discord

Discord Forum

Text content does not match server -renderd HTML

Unanswered
Horned Puffin posted this in #help-forum
Open in Discord
Horned PuffinOP
import CallToAction from "@/components/blocks/call-to-action";
import Banner from "../Banner";

export default function ContentArea(props: any) {
return props.Components.map(function (component: any) {
if (component.ContentLink?.Expanded.typename == "HiSoftCallToAction") {
return (
#Unknown Channel
<CallToAction
key={component.ContentLink.Expanded.
typename}
title={component.ContentLink.Expanded.Title}
description={component.ContentLink.Expanded.Description}
/>
</>
);
} else if (component.ContentLink?.Expanded.typename == "HiSoftBanner") {
return (
#Unknown Channel
<Banner key={component.ContentLink.Expanded.
typename} />
</>
);
}
});
}







Getting this error Unhandled Runtime Error
Error: Text content does not match server-rendered HTML.

See more info here: https://nextjs.org/docs/messages/react-hydration-error

2 Replies

I assume you are switching between those conditional statements after the rendering has been done?
I think that might be the problem