Put in order · Next.js course · Module 2: Routing and Layouts

Creating a Dynamic Route

Arrange the steps for creating a dynamic route in App Router

Items to put in order

  • Use the parameter in the component
  • Add a page.js file in the directory
  • Create a directory with brackets [slug]
  • Receive the parameter through props.params
Show the answer

Correct order:

  1. Create a directory with brackets [slug]
  2. Add a page.js file in the directory
  3. Receive the parameter through props.params
  4. Use the parameter in the component