Go back/forward #181
Replies: 9 comments 12 replies
-
Of course I found my answer right after posting this. |
Beta Was this translation helpful? Give feedback.
-
Late 2023 answer: const router = useRouter();
const onBack = () => router.history.back(); |
Beta Was this translation helpful? Give feedback.
-
Any update on this? I would like to able to navigate back only in the scope of app routing and don't go back to the page I was before I came to this app. |
Beta Was this translation helpful? Give feedback.
-
Such a basic thing should be in the docs |
Beta Was this translation helpful? Give feedback.
-
I used it like this : const { history } = useRouter()
onClick={() => history.go(-1)} |
Beta Was this translation helpful? Give feedback.
-
None of the proposed solutions allow app back/forward navigation without a page reload. Would be very nice to have this feature. |
Beta Was this translation helpful? Give feedback.
-
Anyway to determine if there is something beyond the current route on the stack? |
Beta Was this translation helpful? Give feedback.
-
With the new release of // something like could be added to specify that we are going backwards,
// but the "to" route is still provided in case canGoBack is false
// given the current route is /users/$userId
<Link to="/users" direction="back" /> Currently I am wrapping the This would be really helpful in order to preserve url params and scroll-restoration |
Beta Was this translation helpful? Give feedback.
-
I also faced this same issue, this is the 2nd project I'm working on that uses Tanstack router. I also combed docs but I didn't see it listed in the docs. So instead of using a LLM to find I said lemme go with the "old school" way of doing it. I Googled and here am I. @tannerlinsley Pls the Tanstack Router needs to be updated like how the React Query Docs is. Or at least show how these functionalities work. Thank you and thanks for all the good things you're doing for the community. |
Beta Was this translation helpful? Give feedback.
-
In react-router you have the ability to do
history.goBack
. I have combed through the docs and have not found a way to do this in react-location. What is the best way to accomplish this?Beta Was this translation helpful? Give feedback.
All reactions