cyntler / hamburger-react

Animated hamburger menu icons for React.js weighs only 1.5 KB.
https://hamburger-react.netlify.app
MIT License
972 stars 36 forks source link

using with SSR / NextJS. Warning: Did not expect server HTML to contain a <img> in <div>. #30

Closed agustif closed 3 years ago

agustif commented 3 years ago

Closed

luukdv commented 3 years ago

This error doesn't originate from hamburger-react, since there is no <img> element and no evaluation that differs based on context (SSR vs browser).

Not all relevant code is provided so it's hard to debug, but this error is based on a mismatch in the HTML that's rendered on the server vs the hydrated HTML. You could search for logic that is based on browser-specific API's that aren't available in Node. For example, rendering something based on a window property, localStorage, etc.

Let me know if you have any questions.