TanStackT
TanStack10mo ago
4 replies
dead-brown

Redirect in beforeLoad is causing infinite routing

I just notice that navigating to route whose parent route has a redirect in it's beforeLoad method, routes infinitely.

i.e i navigate to '/patients', in it's beforeLoad method, i redirect to another route, say '/patients/approved', instead of redirecting as expected it causes a loop between the two routes or any other route i navigate to after this.

Has anyone experience this before? It was working fine before, i don't what i did wrong.

And i have been trying to reproduce this but can't

https://stackblitz.com/edit/tanstack-router-ssubhpym?file=package.json
Screenshot_2025-03-24_at_18.42.32.png
StackBlitzChigoziem Nwaiwu
Run official live example code for Router Basic File Based, created by Tanstack on StackBlitz
Router Basic File Based Example (forked) - StackBlitz
Was this page helpful?