<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: udit saurabh</title>
    <description>The latest articles on DEV Community by udit saurabh (@udit_saurabh_86a790171b67).</description>
    <link>https://dev.to/udit_saurabh_86a790171b67</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2923678%2F66731f2e-f579-4e06-8164-97643a57d634.png</url>
      <title>DEV Community: udit saurabh</title>
      <link>https://dev.to/udit_saurabh_86a790171b67</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/udit_saurabh_86a790171b67"/>
    <language>en</language>
    <item>
      <title>Dynamic routes in Next</title>
      <dc:creator>udit saurabh</dc:creator>
      <pubDate>Sat, 08 Mar 2025 15:40:30 +0000</pubDate>
      <link>https://dev.to/udit_saurabh_86a790171b67/dynamic-routes-in-next-5e84</link>
      <guid>https://dev.to/udit_saurabh_86a790171b67/dynamic-routes-in-next-5e84</guid>
      <description>&lt;p&gt;*&lt;em&gt;Dynamic routes in&amp;nbsp;Next.js&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
Dynamic routes have something dynamic/changing about routing and paths.&amp;nbsp;&lt;br&gt;
In our hotel management project, suppose we create a route blog section and wish to display blogs based on dynamic route change, like blog/1,blog/2, etc, then we can use this functionality.😁😁😁😁😁😁&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Funj0fnppntlistwdgmii.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Funj0fnppntlistwdgmii.png" alt="Image description" width="560" height="178"&gt;&lt;/a&gt;&lt;br&gt;
We can do dynamic routing in just 2 simple steps.&lt;br&gt;
Create a folder with the name blog (folder name along which we need to create the blog posts).&lt;br&gt;
Create another folder for the dynamic route like in /blog/2 for 2 by the name of [id]. In the folder [id] we create a file for page.tsx for rendering the jsx content.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmyhz1jwbydjuros3oswo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmyhz1jwbydjuros3oswo.png" alt="Image description" width="560" height="178"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fooy8m4kz4hcul486nt22.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fooy8m4kz4hcul486nt22.png" alt="Image description" width="800" height="354"&gt;&lt;/a&gt;&lt;br&gt;
Code for extracting the dynamic route value for using it like id or&amp;nbsp;slug.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export default async function Page({
    params,
  }: {
    params: Promise&amp;lt;{ id: string }&amp;gt;
  })  
{
    const {id} = await params
    return( &amp;lt;div&amp;gt;this is id {id}&amp;lt;/div&amp;gt;)
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>webdev</category>
      <category>programming</category>
      <category>nextjs</category>
      <category>typescript</category>
    </item>
  </channel>
</rss>
