Pages
import Link from 'next/link'; //must have a tag inside
export default function FirstPost() {
return (
<>
<h1>First Post</h1>
<h2>
<Link
href={{
pathname: '/about',
query: { name: 'test' },
}}
>
About us
</Link>
<Link href={`/blog/${encodeURIComponent(post.slug)}`}>
{post.title}
</Link>
<Link
href={{
pathname: '/about',
query: { name: 'test' },
}}
>
About us
</Link>
</h2>
</>
)
}Outer Component
Layouts
Linking
Catch-all Routes
Router
Redirecting Link permantely
Redirecting in JS
Last updated