Weird whitespace behaviour in Next
Unanswered
Mozzy posted this in #help-forum
MozzyOP
I am facing an issue after trying out
Getting multiple "Minified React error" related to hydration.
The issue is visible in the GIF. The description is
and yet the whitespace flickers.
generateStaticParams.Getting multiple "Minified React error" related to hydration.
The issue is visible in the GIF. The description is
<p className="whitespace-pre-line">{project.description}</p>and yet the whitespace flickers.
7 Replies
Asian black bear
@Mozzy I am assuming this is some kind of an issue with minification, because the process does not understand the implications of CSS making whitespace more significant...
using
<br/> is another option 🙂MozzyOP
Yup, but my data is just strings in this case
Asian black bear
That is kind of a pain. Maybe try doing something like
{dataString.split(/\n/).map((s)=><>{s}<br/></>)}use the full fragment syntax to add a key
<React.Fragment key={your key}>the index is probably reasonable if your string never changes