While updating NextJS from v13 to v14, I encountered a Hydration error due to dynamic imports. Is there a way to resolve this issue?
const MyComponent = dynamic(() => import('../components/MyComponent'))
Is there a fix that allows for both lazy loading and SSR rendering?
After some research, I came across 2 possible solutions:
- Eliminate dynamic imports:
import MyComponent from '../components/MyComponent'
- Turn off SSR:
const MyComponent = dynamic(() => import('../components/MyComponent'), { ssr: false })