T
TanStack13mo ago
adverse-sapphire

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
adverse-sapphire
adverse-sapphireOP13mo 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 .
useful-bronze
useful-bronze13mo ago
how would you handle the case when user directly gets to a page via an external link?
adverse-sapphire
adverse-sapphireOP13mo ago
Yes, I have a default handler when it is direct link

Did you find this page helpful?