Skip to content

Instantly share code, notes, and snippets.

@kseikyo
Created November 16, 2022 17:21
Show Gist options
  • Select an option

  • Save kseikyo/fb260a82fae06a62735fbd875e909236 to your computer and use it in GitHub Desktop.

Select an option

Save kseikyo/fb260a82fae06a62735fbd875e909236 to your computer and use it in GitHub Desktop.
Fix hydration issues when using svgs - next js
// 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