I'm trying to understand how SSR/SSG/ISR rendering behavior works in Next.js version 14 with the new app router.
In the past I remember that Next.js offered reserved functions called getServerSideProps to fetch or do some work in the server (SSR) or the getStaticProps to generate the data during the build and cache it on the server (If I understand correctly).
What is the equivalent for these in Next.js 14 with the new app router?
Also, I saw in the docs that they are showing only examples with the fetch native API, Can I use axios library to make HTTP request and have the same behavior?
Thanks!
You can use any kind of method for fetching data in pages files. You should use promises direct in the page Component. Here is the documentation where you can see how to do that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With