Created
November 16, 2022 17:21
-
-
Save kseikyo/fb260a82fae06a62735fbd875e909236 to your computer and use it in GitHub Desktop.
Fix hydration issues when using svgs - next js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Disable ssr when importing the SVG that's causing the hydration issue | |
| // as any is used because you'll get a type error if you try to set a property like width or height | |
| const SVG = dynamic(() => import('path_to_svg'), { | |
| ssr: false, | |
| }) as any; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment