react-router-ssr icon indicating copy to clipboard operation
react-router-ssr copied to clipboard

Render All Componetnts

Open Saeeed-B opened this issue 3 years ago • 4 comments

I can say for sure that this package does not render all components. It seems to render selectively

Saeeed-B avatar Feb 24 '22 07:02 Saeeed-B

In many of my routes something like this renders, This is not the content of the components at all

image

Saeeed-B avatar Feb 24 '22 07:02 Saeeed-B

@Saeeed-B can you please provide a minimum reproduction with this?

StorytellerCZ avatar Feb 28 '22 18:02 StorytellerCZ

I use Meteor.user() directly (without client condition), could this be the cause?

Saeeed-B avatar Mar 07 '22 16:03 Saeeed-B

@StorytellerCZ @copleykj @CaptainN The problem is exactly here: Dynamically imported components do not have ssr I used the following package for dynamic import : https://github.com/CaptainN/npdev-react-loadable

I tested exactly how many routes, when they are imported with loadable, there is no ssr anymore

Saeeed-B avatar Apr 03 '22 13:04 Saeeed-B

So I think that this is specifically an issue with this package. The issue here is that when server rendering while using the lodable package, there isn't a way to pause the execution and wait for the promises to resolve. IF perhaps the loadable package were Suspense compatible, then the render would be able to wait for the promise to settle before finishing the render process, but that would be up to the loadable package to implement, and you to utilize the <Suspense> API

copleykj avatar Jun 04 '24 03:06 copleykj