Add back functionality to Router
See original GitHub issueIt should be easy to navigate back. Right now there’s no built-in way to do this. We already use navigate
to navigate programatically. It might make sense to add the back-navigation feature there:
navigate.back()
The way it’s done natively with web apis is via history’s back
and go
properties. back
does what you would expect, and go
takes a number, so you can go back multiple pages. Do we want to enable that kind of functionality too?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:9
- Comments:11 (7 by maintainers)
Top Results From Across the Web
Handle back button with react router - Stack Overflow
Browser back button works on your routes history. It will not invoke your programmatically handled routing. That's the point where ...
Read more >BackButton - React Router: Declarative Routing for React.js
Connects the global back button on Android and tvOS to the router's history. On Android, when the initial location is reached, the default...
Read more >Create a Back button with React Router | bobbyhadz
To create a back button with React Router, set the `onClick` prop on a button to a function. Use the `useNavigate()` hook, e.g....
Read more >How to Create Custom Back Button with React Router DOM v6
In this article, we will cover how to create a custom back button and implement a back button in React using React Router...
Read more >Create a Back button with React Router - Datainfinities
To create a back button with React Router use useNavigate() hook. Call navigate function eg. navigate(-1); inside the onClick function of the back...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I would like to work on the issue @peterp @jtoar
Hey @thedavidprice @jtoar @peterp, can I work on this.
Edit: After a quick look at the source code I got to know that
navigate
is implemented as a functionnavigate()
, so how should thisback
be implemented, I don’t think this is possiblenavigate.back()
(I might be wrong 😅, please correct me) `