Ability to use app router like getInitialProps #53240
Replies: 4 comments 1 reply
-
I have the same curiosity to know exactly the same about how to use something similar to getInitialProps in app router, in the documentation suggest using fetch for data fetching but there isn't any use case in we can achieve the same behavior as getInitialProps |
Beta Was this translation helpful? Give feedback.
-
Still no answer... this is a functionality we need |
Beta Was this translation helpful? Give feedback.
-
Could you give typical use cases ? |
Beta Was this translation helpful? Give feedback.
-
I would also like to share my use case: Currently, using getInitialProps, when a user first visits my site:
then on client-side navigation:
So on client-side navigation, the FE server is never involved, except when loading javascript chunks due to code splitting and dynamic imports. I would love to find out if there is a way to implement my use-case with "App Router" |
Beta Was this translation helpful? Give feedback.
-
Hi all,
I started exploring app router and the biggest win from pages is getInitialProps which runs page first time on the server and then if we navigate to the same page with next links, data is fetched on the client. Is there some way to achieve this thing same with app router? Because it seems it's always that page needs to served from the server or from the client.
Beta Was this translation helpful? Give feedback.
All reactions