uruha/next-with-ts

Change getInitialProps for getStaticProps or getServerSideProps

Closed this issue · 0 comments

uruha commented

Next.js (v9.3 >= ) said,

Recommended: getStaticProps or getServerSideProps

If you're using Next.js 9.3 or newer, we recommend that you use getStaticProps or getServerSideProps instead of getInitialProps.

These new data fetching methods allow you to have a granular choice between static generation and server-side rendering. Learn more on the documentation for Pages and Data fetching:

So, We should change getInitialProps logics.