I want to use https://reactrouter.com/en/main/components/link#link for client side routing, but I want the styles of https://mantine.dev/core/anchor/, how can I achieve this?
#How to use react-router-dom's `<Link>` with `Anchor`
5 messages · Page 1 of 1 (latest)
I tried this:
<Link to={`/Home`} key={"/Home"} className='link'><Anchor>Home</Anchor></Link>
and removing all the styles from the .link class.
but then I got the warning:
Warning: validateDOMNesting(...): <a> cannot appear as a descendant of <a>.
you can use the polymorphic way
<Anchor component={Link} to={"/Home"}>
Home
</Anchor>
https://mantine.dev/guides/polymorphic/#polymorphic-components-as-other-react-components