0

Perhaps I misunderstand how the next/dynamic components work... but when I have code like this:

const RealContent = dynamic(() => import('./RealContentComponent'), {
  loading: () => <span>...placeholder Not Real Content...</span>,
  ssr: true,
}) 

I expect, on the server side rendered HTML file that the <RealContent/> component would render out what's in ./RealContentComponent

But when I do a next build and then look in the .next/server/pages/RealContent.html page, all I see is the span with ...placeholder Not Real Content

shouldn't the ssr: true force it to render out the actual component during build time. (there's nothing in the RealContentCompnent that requires the client.)

Chenzo
  • 325
  • 1
  • 5
  • 17

1 Answers1

0

It turns out it's our code. I made an example repo showing how it works... https://github.com/Chenzo/dynamic-ssr-test

if you have SSR: True it does render it out when npm run build

Chenzo
  • 325
  • 1
  • 5
  • 17