Z
Z
zWaterFall2019-11-26 08:52:17
JavaScript
zWaterFall, 2019-11-26 08:52:17

Is it possible to get the previous react-router-dom route?

On my site, I go to: /main -> /solvation -> /registration -> /login
Is there any way I can go back from /login , ignoring /registration , so that after logging in I go back to /solvation ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Robur, 2019-11-26
@Robur

You just need to change from registration to login, do not add, but replace the route
was: /main -> /solvation -> /registration
go to /login, it becomes: /main -> /solvation -> /login
in this case everything works as it should automatically.
Replace the route - depending on how you implemented it, if through https://reacttraining.com/react-router/web/api/Lin...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question