In this video, we’ll explore how to use generateStaticParams() in the new App Router of Next.js to convert dynamic routes into static pages for better performance. We’ll start with how database queries work in each request, detect if a page is static or dynamic, and then learn to pre-generate pages using this powerful Next.js feature.
Get MySQL Live Recorded Videos Here: https://kodyfier.com/mysql-live-class-recorded-videos.php
Get Source Code for Free! Grab Now - https://www.thapatechnical.com/2025/06/nextjs-series-in-2025.html
Get All My YouTube Videos' Source Code for just ₹199! Grab Now - https://thapatechnical.shop/source-code
------------------------------------------------------------------------
Boost Your Skills with these Pre-Requisite Videos:
Best HTML Course - https://youtu.be/5ccq_nLHneE
Best CSS Course - https://youtu.be/MSICFljRcb4
JavaScript Basics Course Part 1 - https://youtu.be/13gLB6hDHR8
JavaScript Advanced Course Part 2 - https://youtu.be/YwsOCN8woA8
------------------------------------------------------------------------
Build Your Own E-commerce Website for Free! - https://www.thapatechnical.com/2024/03/build-complete-ecommerce-website-using.html
------------------------------------------------------------------------
Join Us!
Become a Member: Unlock perks, free source code, and more Join Now : https://www.youtube.com/channel/UCwfaAHy4zQUb2APNOGXUCCA/join
Connect on Instagram: https://www.instagram.com/thapatechnical
Join Our Discord Server: Hang out with fellow programmers Discord Link: https://discord.gg/MdScmCsua6
------------------------------------------------------------------------
TIMELINE
0:00 - What is generateStaticParams in Next.js
0:20 - How our app calls the database on each request
1:40 - Check if your page is dynamic or static
3:00 - Convert dynamic page to static page (SSG)
3:15 - Real use-case of generateStaticParams with database
6:30 - Why we convert ID to string for route params
10:00 - Final thoughts and outro