nextjs-with-react-intl
nextjs-with-react-intl copied to clipboard
How to use `getServerSideProps` or `getStaticProps` instead of `getInitialProps`
My current project has a need to support more than one locale. I am also trying to have as many pages SSG'd or SSR'd as possible i.e with AMP optimisations. Having the getInitialProps in the _app more or less rules out SSR as is the case here.
The official example does it via _document but i was getting some error or the other when integrating it onto my project (serverless). Before another attempt in a fresh project i searched around a bit and came across your project. I find that your example is simple enough to understand, integrate and learn from as well.
Do you have any suggestions or tips to either move out the getInitialProps from _app or use getServerSideProps. I am assuming getStaticProps wont really be a solution in this case.
EDIT:
Incidentally, the official example does use getInitialProps in _app.ts as well.