Answers for "how to pass params in router next js"

-1

get parameter from next.js route

import {useRouter} from "next/router";

export default function Items() {
  const { query } = useRouter();
  return (
    <div>
      <h1>Items page</h1>
      <p>{query.id}</p>      <p>{query.name}</p>    </div>
  );
}
Posted by: Guest on June-28-2021

Code answers related to "how to pass params in router next js"

Browse Popular Code Answers by Language