#Using `Link` in NavLink

6 messages · Page 1 of 1 (latest)

wary delta
#

I am currently using useNavigate from react-router-dom with Mantine's NavLink component

<NavLink key="1" label="Home" onClick={() => navigate('/')} />

I have read that it is better to use Link from react-router-dom for this sort of thing. What is the advised way to do this? I know with the Text component, you can just do

<Text component={Link}

But what about in NavLink. Should I do

<NavLink key="1" label="Home">
    <Link to="/" />
</NavLink>

?

viral current
wary delta
viral current
wary delta