K
K
KirylLapouski2018-03-23 19:41:10
React
KirylLapouski, 2018-03-23 19:41:10

How to change url from react component without reloading the page?

How to change URL from onClick handler? Changes the URL, but the components are not redrawn. If you wrap the button in a Link, everything works fine, but this method is not suitable.
history.pushState(null, '', '/user/'+user);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Oleg Gamega, 2018-03-23
@KirylLapouski

https://reacttraining.com/react-router/web/example...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question