#Best way to accomplish getStaticProps and getServerSideProps on the same page

2 messages · Page 1 of 1 (latest)

subtle quest
#

Related to https://github.com/vercel/next.js/issues/35704 is there a better way to use next-i18next serverSideTranslations in combination with the getServerSideProps recommended by next-auth?

I'm thinking that the next-auth stuff can't be done in getStaticProps because of getCsrfToken, but it's also not ideal for the translations to be processed every time the page is loaded.

GitHub

Verify canary release I verified that the issue exists in Next.js canary release Provide environment information npm. 8.5.5 next: 10.x , What browser are you using? (if relevant) Safari & B...

sleek summit
#

it works the same way in getServerSideProps so you can just remove getStaticProps and move the i18n logic in getServerSideProps