question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add back functionality to Router

See original GitHub issue

It 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:closed
  • Created 3 years ago
  • Reactions:9
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
shakti97commented, Oct 1, 2020

I would like to work on the issue @peterp @jtoar

1reaction
saideepesh000commented, Mar 26, 2021

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 function navigate(), so how should this back be implemented, I don’t think this is possible navigate.back() (I might be wrong 😅, please correct me) `

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found