question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use getServerSideProps instead of getInitialProps

See original GitHub issue

According 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:open
  • Created 3 years ago
  • Reactions:10
  • Comments:7

github_iconTop GitHub Comments

8reactions
meliborncommented, May 9, 2021

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.

7reactions
dvakatsiienkocommented, Feb 19, 2021

Addition of getServerSideProp and getServerSideProp is greatly desirable, since getInitialProps will be deprecated and most likely deleted from next.js.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found