S
S
semennn2018-05-23 13:19:21
React
semennn, 2018-05-23 13:19:21

How to navigate to another uri in React?

Hello!
If I want to add a transition to another uri on the button, how to implement it?
I can wrap the button tag in <Link>or <Redirect>, and if I just want to hang a handler, how can I make the transition in the class method itself? I can no longer use them there.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim, 2018-05-23
@semennn

history.push
Article (en)
Summary: You can use the browserHistory API or the hashHistory API which allows you to navigate between URLs without reloading the page. Therefore, the history has a push method that will allow you to go to a new address and save the previous one so that the "back" button works

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question