diff --git a/.changeset/red-sheep-peel.md b/.changeset/red-sheep-peel.md new file mode 100644 index 000000000..04abc02c0 --- /dev/null +++ b/.changeset/red-sheep-peel.md @@ -0,0 +1,5 @@ +--- +'@myst-theme/site': patch +--- + +Change to NavLink provider for internal links diff --git a/packages/site/src/components/Navigation/TopNav.tsx b/packages/site/src/components/Navigation/TopNav.tsx index 8e235ff03..c323bbb20 100644 --- a/packages/site/src/components/Navigation/TopNav.tsx +++ b/packages/site/src/components/Navigation/TopNav.tsx @@ -1,4 +1,3 @@ -import { NavLink } from '@remix-run/react'; import { Fragment } from 'react'; import classNames from 'classnames'; import { Menu, Transition } from '@headlessui/react'; @@ -12,6 +11,7 @@ import { ThemeButton } from './ThemeButton.js'; import { useBaseurl, useLinkProvider, + useNavLinkProvider, useNavOpen, useSiteManifest, withBaseurl, @@ -34,6 +34,7 @@ function ExternalOrInternalLink({ prefetch?: 'intent' | 'render' | 'none'; }) { const Link = useLinkProvider(); + const NavLink = useNavLinkProvider(); const staticClass = typeof className === 'function' ? className({ isActive: false }) : className; if (to.startsWith('http') || to.startsWith('mailto:')) { return ( @@ -57,6 +58,7 @@ function ExternalOrInternalLink({ } function NavItem({ item }: { item: SiteNavItem }) { + const NavLink = useNavLinkProvider(); if (!('children' in item)) { return (