Q47: How do you migrate getStaticProps and getStaticPaths to the App Router?

  • getStaticProps: Replaced by standard fetch() calls inside Server Components (which cache by default or using { cache: 'force-cache' }).
  • getStaticPaths: Replaced by export async function generateStaticParams().
Key Takeaways
  • getStaticProps -> native cached fetch() calls inside Server Components.
  • getStaticPaths -> generateStaticParams().
Knowledge Check

Which function replaces getStaticPaths when migrating a dynamic route to the App Router?