I am using next.js + mdx-bundler. I have a very basic component that I use within my mdx.
This works:
Mdx is a great <Component>format and I like it a lot</Component>.
Mdx is a great
<Component>format
and I like it a
lot</Component>.
However, if I want to align the component more code-like, opening & closing tags on top and bottom, children just inbetween, it breaks:
Mdx is a great
<Component>
format and I like it a lot
</Component>.
I get a hydration / mismatch error :
Error: Hydration failed because the initial UI does not match what was rendered on the > server.
See more info here: https://nextjs.org/docs/messages/react-hydration-error
And I am not sure why that is? Also, it doesn't seem to happen with all my components. It's just really annoying because it means I can't use / rely on prettier to format my mdx.