You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Until recently, getInitialProps() was the way to load data for pages. Now it's not mentioned in the documentation at all anymore, and has been replaced with instructions on using getServerSideProps() on the server and SWR on the client.
However, it's not just a drop-in replacement. It would be very useful to have a migration guide for applications that have been built on getInitialProps().
The biggest issue for us is that our Redux implementation works with getInitialProps() but not with getServerSideProps(), but that might be out of the scope of a generic Next.js migration guide.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Until recently,
getInitialProps()
was the way to load data for pages. Now it's not mentioned in the documentation at all anymore, and has been replaced with instructions on usinggetServerSideProps()
on the server and SWR on the client.However, it's not just a drop-in replacement. It would be very useful to have a migration guide for applications that have been built on
getInitialProps()
.The biggest issue for us is that our Redux implementation works with
getInitialProps()
but not withgetServerSideProps()
, but that might be out of the scope of a generic Next.js migration guide.Beta Was this translation helpful? Give feedback.
All reactions