Going back to previous route
Hey guys, I have a question.
Is it possible with the tanstack router to go back to the previous visited route? something like
const nav = useNavigate()
nav({ to: -1 })
3 Replies
generous-apricot•3y ago
@Ishida You can try something like
rival-black•3y ago
Yes, this the recommended way.
correct-apricot•3y ago
Is there a way to get the info of this previous route so that we can pass it to the
to prop of a <Link> component, or to be able to use it in different places?
I'm currently using search params but they are strings so things are getting complicated there