NextJS rendering loading state on the SSR and not the actual content #12347
Replies: 3 comments 1 reply
-
I don't think hooks are the issue here exactly. Other approaches would produce the same issue. The reason you're seeing this is because server-side rendering, by default, is only going to do a single pass of a render of your application. The first time you render, Before I'm not sure what the right way to do this with I hope this at least helps make sense of what's happening here. |
Beta Was this translation helpful? Give feedback.
-
@mjm I currently made it work with the following code. Not sure if it is the best solution, but it works.
I also had to make some changes to the apollo-client.
The problem I have now is that all the pages are being SSR even if I don't use |
Beta Was this translation helpful? Give feedback.
-
Hi, I can reproduce a similar issue with the |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm new to Next js and was playing around with SSR. I have the following component. When I checked the source of the page, I don't see the actual content but the loading state.
Is
getServerSideProps
a must use, to render everything at the SSR completely?The problem I see is that I won't be able to use hooks (especially apollo ones with getServerSideProps)
Is there a nice way around this?
Beta Was this translation helpful? Give feedback.
All reactions