Next.js Discord

Discord Forum

Dynamic href is not Supported in the App Router

Unanswered
Common carp posted this in #help-forum
Open in Discord
Common carpOP
I am trying to create dynamic links in my TanStack Table. Here is part of the ColumnDef below -

 export const columns: ColumnDef<Actor>[] = [
  {
    accessorKey: "actorName",
    header: "Actor Name",
    cell: (value) => (
      <Link href={`/actors/${value.toString()}`}>
        <div className="w-[300px]">
          {translateIdToName(value.getValue()) as React.ReactNode}
        </div>
      </Link>
    ),
  },

Here I get "Handling "Dynamic href is not Supported in the App Router" Error in Next.js". The nextJs docs suggestion is to use the actual value but I don't think thats possible in my case. Do you guys have any suggestions ?

0 Replies