Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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>
  );
}
Source by reactgo.com #
 
PREVIOUS NEXT
Tagged: #parameter #route
ADD COMMENT
Topic
Name
6+9 =