-
-
Notifications
You must be signed in to change notification settings - Fork 475
Open
@zurcacielos
</Navbar.Link>
</Navbar.Collapse >
</Navbar.Link>
Description
- I have searched the Issues to see if this bug has already been reported
- I have tested the latest version
Summary
When I do a
import Link from "next/link";
<Navbar.Collapse >
<Navbar.Link as={Link} active={pathname == "/privacy"} href="/privacy">
Privacy Policy
</Navbar.Link>
</Navbar.Collapse >
I'm expecting the navbar to collapse. I use the Link from next/link because Next.js downloads those links in the background and do optimizations.
I also tried
const [open, setOpen] = useState(false);
<Navbar.Link as={Link} onClick={() => setOpen(false)} active={pathname == "/privacy"} href="/privacy">
Privacy Policy
</Navbar.Link>
but it doesn't work.
Context
https://nextjs.org/docs/pages/api-reference/components/link
is a React component that extends the HTML element to provide prefetching and client-side navigation between routes. It is the primary way to navigate between routes in Next.js.
Any help appreciated 🙌