I have created a custom home page and I am using the menu from WordPress admin.
The links work fine, but when I click on the link for the Home it refreshes the site. But the other pages do not refresh, and they come from WP.
How do I stop it from refreshing?
Do I need to use tiny-router? In that case, where do I put the code?
I believe it’s correct, the navigation component by default in mars-theme is configured this way looking for the name of the state:
const Nav = ({ state }) => (
<NavContainer>
{state.theme.menu.map(([name, link]) => {
// Check if the link matched the current page url
const data = state.source.get(state.router.link);
const isCurrentPage = data.route === link;
return (
<NavItem key={name}>
{/* If link url is the current page, add `aria-current` for a11y */}
<Link link={link} aria-current={isCurrentPage ? "page" : undefined}>
{name}
</Link>
</NavItem>
);
})}
</NavContainer>
);