getStaticProps and getServerSideProps not working with custom app
See original GitHub issueWhen having a custom app having something like this in the render method:
<Component {...pageProps} />
getStaticProps or getServerSideProps do not get called.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:7
- Comments:10 (2 by maintainers)
Top Results From Across the Web
Advanced Features: Custom `App` - Next.js
When you add getInitialProps in your custom app, you must import App from "next/app" , call App.getInitialProps(appContext) inside getInitialProps and merge ...
Read more >Unable to use getStaticProps in _app.js - Stack Overflow
For that I've exported the getStaticProps from app.js file. But it doesn't seem to work. Here is my app.js. import Layout from ...
Read more >Fetching and hydrating a Next.JS app using ... - Medium
Fetching and hydrating a Next.JS app using `getServerSideProps` and `getStaticProps` ... First off, this is not a thorough stress analysis.
Read more >Refreshing Server-Side Props - Next.js - Josh W Comeau
Here's my problem: in my dashboard, I'm able to edit users, to bestow purchases or update their name: Notice how the updated name...
Read more >getInitialProps vs. getServerSideProps in Next.js
Inner workings of getServerSideProps and getStaticProps ... By making this change, we fix the problem of context switching that occurs with ...
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 Free
Top 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

Yes, as I understand they only work with page components. But is seems to work only if you do not have a custom app setup. I tried it without and it was working fine. With the custom app the getInitialProps only works but the docs state that this is now deprecated.
Thanks @ijjk for the response. It turns out thing work as expected with the basics indeed. But…as soon as I do:
export default withRedux(initializeStore)(CustomApp);Things break. So it looks like the issue is realted to withRedux.