next js link
import Link from "next/link"; //import this
<Link href="/"> //wrap a tag with Link
<a>Home</a>
</Link>
<Link href="https://nextjs.org"> //external page
<a>Next.js</a>
</Link>
next js link
import Link from "next/link"; //import this
<Link href="/"> //wrap a tag with Link
<a>Home</a>
</Link>
<Link href="https://nextjs.org"> //external page
<a>Next.js</a>
</Link>
router nextjs
import { useRouter } from 'next/router'
function ActiveLink({ children, href }) {
const router = useRouter()
const handleClick = (e) => {
e.preventDefault()
router.push(href)
}
return (
<a href={href} onClick={handleClick} style={style}>
{children}
</a>
)
}
export default ActiveLink
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us