How can I use NextJS link with Chakra-UI link together
I am creating a SPA with NextJS and using Chakra-UI as UI component library. How can I use the link components of them together?
4493 views
π
2
I am creating a SPA with NextJS and using Chakra-UI as UI component library. How can I use the link components of them together?
4493 views
The creator of Chakra-UI posted the solution here
import { Link } from "@chakra-ui/core"
import NextLink from "next/link"
<NextLink href="/..." as={...} passHref>
<Link ... >Chakra styled link</Link>
</NextLink>
The magic happens with passHref
property of NextJS link π