Next.js Discord

Discord Forum

Issue with Multiple Values for params.id in Next.js Dynamic Route

Unanswered
Giant panda posted this in #help-forum
Open in Discord
Giant pandaOP
I'm developing a Next.js application with a dynamic route at /instructors/[id]. I'm encountering an issue where the id parameter seems to be read multiple times with different values. Below is the relevant code snippet:

import { api } from '@/trpc/server';
import { InstructorView } from '@/views';

export default async function InstructorPage({
  params,
}: {
  params: { id: string };
}) {
  console.log(params.id);

  return <InstructorView.Instructor />;
}

1 Reply