#Get the `from` location when user navigates

3 messages · Page 1 of 1 (latest)

forest heath
#

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

forest heath
#

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 .

cobalt arrow
#

how would you handle the case when user directly gets to a page via an external link?