pages/_app.js doesn't have getStaticProps
See original GitHub issueFeature request
I think _app.js also should have getStaticProps
as Layout, Providers etc can use it’s data.
(Having that _app.js has getInitialProps it will be good)
Issue Analytics
- State:
- Created 3 years ago
- Reactions:65
- Comments:13 (3 by maintainers)
Top Results From Across the Web
How to use getStaticProps in _app.js for showing data fetched ...
And I want to use getStaticProps to get those data on all the pages. But the problem is I need to do getStaticProps...
Read more >getStaticProps on _app · Discussion #10949 · vercel/next.js
Since getStaticProps is a static function that is exported by the file, and not connected to the page function, this makes total sense....
Read more >Data Fetching: getStaticProps - Next.js
When you navigate to a page that's pre-rendered using getStaticProps , Next.js fetches this JSON file (pre-computed at build time) and uses it...
Read more >What's New in Next.js 13 - AppSignal Blog
Let's explore the new features and improvements in Next.js 13.
Read more >Updating the properties of the getstaticprops method ... - Webera
After the page is rendered by the server, these attributes are immutable. ... Since Next.js does not have a “refetchProps” method, we can...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have a select menu inside my app header that I want to pre-populate with data at build. I wrap all pages with this in
_app.tsx
.getStaticProps
would be useful here, else I have to put this on every page individually, and pass props downAny news on this, is the restriction going to be lifted?
My use case: Fetch Site meta data and navigation menus.