Next.js · Middle · Question 16 of 75
Can you use next/dynamic with ssr: false in a server component?
- ✓Correct answer: No:
ssr: falseis allowed only in client components - 2Yes, it's the main way to disable SSR for a page
- 3Yes, but only in
layout.tsx
Explanation
Use the ssr: false option inside a 'use client' file: for example, for a component that accesses window on import. In a server component, Next.js throws an error. Server components don't ship their code to the browser anyway.