import Link from 'next/link';
const people = [
{ v: 'car', name: 'bruno' },
{ v: 'bike', name: 'John' },
{ v: 'airplane', name: 'Mick' }
]
export default function Details() {
return <div>
{people.map(e => (
<div key={e.v}>
<Link as={`/${e.v}/${e.name}`} href="/[vehicle]/[person]">
<a>Navigate to {e.name}'s {e.v}</a>
</Link>
</div>
))}
</div>
}
import { useRouter } from 'next/router';
export default function Person() {
const router = useRouter();
console.log(router.query);
return <h2>{router.query.person}'s {router.query.vehicle}</h2>
}
export default function Index() {
return <h1>Lorem ipsum dolor sit amet 1</h1>
}