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
I'm new to Next.js (I use 9.4) and currently I try to get an better understand on how it works. In my /pages components I use getStaticProps and getServerSideProps. From the documentation I understood that these never run on the client. getStaticProps is used when it is rendered statically and getServerSideProps is used on every request. Besides these functions I use getInitialProps in my extended App component in _app.js. I use it in order to fetch the localization strings and pass it to the components. I would assume that getInitialProps runs only once during build and then the information is made available to the pages statically. Is that assumption correct?
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.
-
I'm new to Next.js (I use 9.4) and currently I try to get an better understand on how it works. In my /pages components I use
getStaticProps
andgetServerSideProps
. From the documentation I understood that these never run on the client.getStaticProps
is used when it is rendered statically andgetServerSideProps
is used on every request. Besides these functions I usegetInitialProps
in my extended App component in _app.js. I use it in order to fetch the localization strings and pass it to the components. I would assume thatgetInitialProps
runs only once during build and then the information is made available to the pages statically. Is that assumption correct?Beta Was this translation helpful? Give feedback.
All reactions