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>
);
}