How to fix it:
export const CorrectComponent = () => {
return (
This is correct and should work because a div is really good for this
task.
</div>
<Image src="/vercel.svg" alt="" width="30" height="30" />
</div>
Common causes with css-in-js libraries:
When using Styled Components / Emotion
- When css-in-js libraries are not set up for pre-rendering (SSR/SSG) it will often lead to a hydration mismatch. In general this means the application has to follow the Next.js example for the library. For example if
pages/_document is missing and the Babel plugin is not added.
- Possible fix for Styled Components: