Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use getServerSideProps instead of getInitialProps #155

Open
ka8725 opened this issue Feb 10, 2021 · 7 comments
Open

Use getServerSideProps instead of getInitialProps #155

ka8725 opened this issue Feb 10, 2021 · 7 comments

Comments

@ka8725
Copy link

ka8725 commented Feb 10, 2021

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!

@dvakatsiienko
Copy link

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

@chemicalkosek
Copy link

It won't be deleted. getInitialProps is still feasible for a lot of apps.

@zenflow
Copy link

zenflow commented Mar 28, 2021

since getInitialProps will be deprecated and most likely deleted from next.js

@dvakatsiienko Where are you getting this information? I doubt this because it still has its advantages over getServerSideProps in some/many cases. The reason getInitialProps is discouraged (but still fully supported) is because it's easy to mess up if you're not careful about what you're doing (vercel/next.js#13864). So if you're careful you can make some optimizations using getInitialProps. next-with-apollo uses getInitialProps safely, so there is no advantage from switching to getServerSideProps.

@meliborn
Copy link

meliborn commented 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.

@sergeyshaykhullin
Copy link

Getting same conflict 😢

@kachar
Copy link

kachar commented Sep 4, 2021

Same conflict one more time

@kylemocode
Copy link

Same conflict 🥲

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants