Is there a non getInitialProps way to get SSR data only on direct load? #16760
Unanswered
maxschmeling
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The docs seem to suggest that
getInitialProps
is no longer recommended for use. However, I don't see any other way to accomplish SSR or direct page loads without remote calls for client side routing.I want to render user info for the currently logged in user in the header of my app and I want that to use SSR. However, I don't want a remote request to be made for every single page load to get that details because it's going to always stay the same and is already in my Apollo cache after the initial server render.
Is there a more "modern" Next.js way to accomplish this?
Beta Was this translation helpful? Give feedback.
All reactions