How to detect previous route? - TanStack