Q
Q
qfrontend2019-03-13 16:04:46
React
qfrontend, 2019-03-13 16:04:46

How to hang an onClick event on a NavLink (ReactRouter) component?

Greetings) How to hang an onClick event on NavLink from ( ReactRouter)? I need an action to be launched on a click on the NavLink , but by hanging this on the onClick event , the page reloads. Thank you)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kirill Wolf, 2019-03-18
@Deimosss88

like any other link: onClick={(event) => {event.preventDefault()}}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question