Fetch messages once in a central place? (getStaticProps) #810
-
Hey, I'm using the pages router, everything works great and now I'm looking into optimization. Is this really the way to go or can I fetch the translations once in a central place? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
If you use the same messages on every page and have no need for splitting, you can also fetch them via |
Beta Was this translation helpful? Give feedback.
If you use the same messages on every page and have no need for splitting, you can also fetch them via
App.getInitialProps
. Note that this will disable SSG, except for if you define agetStaticProps
function in your pages (even if it just returns an empty object). Hope this helps!