T
TanStack10mo ago
dependent-tan

Get the `from` location when user navigates

I am using Tanstack for the first time and could not find the answer to my current issue. I want to get the from location inside a component. That is , from which path did the user take to come to the current component . Inside from my component , I want to later navigate back to the from address. How could I do this. Thanks
3 Replies
dependent-tan
dependent-tanOP10mo ago
I have now looked into passing state , which keeps giving me type error and hence not able to figure that out. I do not want to use the window.history.back() option .
extended-salmon
extended-salmon10mo ago
how would you handle the case when user directly gets to a page via an external link?
dependent-tan
dependent-tanOP10mo ago
Yes, I have a default handler when it is direct link

Did you find this page helpful?