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
In our app, we need to fetch categories to build the app-wide navigation. This data needs to be present on all pages. So the perfect location for the data fetching would be app.js.
Since _app.js only supports the getInitialProps method. This would disable all benefits from static generation you get by using getStaticProps.
Whats the recommended way to fetch data statically when it's needed on every page? Did you find solutions for this?
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.
-
Hi!
In our app, we need to fetch categories to build the app-wide navigation. This data needs to be present on all pages. So the perfect location for the data fetching would be
app.js
.Since
_app.js
only supports thegetInitialProps
method. This would disable all benefits from static generation you get by usinggetStaticProps
.Whats the recommended way to fetch data statically when it's needed on every page? Did you find solutions for this?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions