How to Use getStaticProps Equivalent in Next.js app Directory for Static Data Fetching?
Answered
Keyhole wasp posted this in #help-forum
Keyhole waspOP
I'm working with the app directory in Next.js, and I can't use getStaticProps or getStaticPaths for my folder structure (e.g., app/blog/page.tsx). How can I achieve static data fetching and dynamic route generation (like getStaticProps and getStaticPaths) using the app directory? Specifically, I want to fetch data for /blog and /blog/[slug] routes while keeping my shared layout and styles intact. Any guidance would be appreciated!
2 Replies
Keyhole waspOP
Thanks for the resource. Much Appreciated