What is a difference between dynamic imported component with ssr: true:
const DynamicButton = dynamic(() => import('./Button').then((mod) => mod.Button), {
ssr: true,
});
and just normal component import:
import { Button } from './Button';
- What is the benefit of one over the other?
- Where do we put load on?
- For scenario below (JSX example), if
showButtonisfalse, did we still loadDynamicButtonand where?
// jsx
return showButton && <DynamicButton />