Add a link snippet

This commit is contained in:
Shu Uesugi
2020-04-20 19:24:10 -07:00
parent 3e9cb6f9d9
commit 2101ba05c9

View File

@@ -0,0 +1,17 @@
// Example: Adding className with <Link>
import Link from 'next/link'
export default function LinkClassnameExample() {
// To add attributes like className, target, rel, etc.
// add them to the <a> tag, not to the <Link> tag.
return (
<Link href="/">
<a className="foo" target="_blank" rel="noopener noreferrer">
Hello World
</a>
</Link>
)
}
// Take a look at https://nextjs.org/docs/api-reference/next/link
// to learn more!