I have been learning about Next.js and I am struggling with understanding how to set up dynamic routing. I have the following setup: https://i.stack.imgur.com/uBPdm.png https://i.stack.imgur.com/YYSxn.png
"use client"
import React from "react";
import { useRouter } from "next/router";
const ID = () => {
const router = useRouter();
return <div>{router.query.id}</div>;
};
export default ID;
There are various sources suggesting that the dynamic route name should be in the folder name while others, like the official documentation, state it should be in the file name. How can I successfully implement dynamic routes in Next.js?