Use getServerSideProps instead of getInitialProps
See original GitHub issueAccording to the official doc of next.js it’s recommended to use getStaticProps
or getServerSideProp
instead of getInitialProps
. Can it be added to this lib? Does that make sense? Thanks!
Issue Analytics
- State:
- Created 3 years ago
- Reactions:10
- Comments:7
Top Results From Across the Web
getInitialProps vs. getServerSideProps in Next.js
Is there a difference between getInitialProps and getServerSideProps ? ; getInitialProps and the newer ; getServerSideProps is how the function is ...
Read more >getServerSideProps vs getInitialProps getStaticProps in ...
getInitialProps is being deprecated instead of this function, the main reason being to give you greater control over where the code is ran....
Read more >getInitialProps vs getServerProps · Discussion #11211
getServerSideProps has slightly different semantics than getInitialProps . On client-side transitions getInitialProps will execute it's code in the browser, ...
Read more >getInitialProps - Data Fetching
getInitialProps will then run on the client when navigating to a different route via the next/link component or by using next/router . However,...
Read more >Getserversideprops vs Getinitialprops
getServerSideProps is very similar to getInitialProps, meaning that it gets called every time that you load the page, but the code is only...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have a conflict with https://github.com/isaachinman/next-i18next because it uses
getServerSideProps
to load locales. But it’s not possible to use getServerSideProps and getInitialProps at the same time.Addition of
getServerSideProp
andgetServerSideProp
is greatly desirable, sincegetInitialProps
will be deprecated and most likely deleted fromnext.js
.