Maximum update depth exceeded when redirecting
Hello I have this setup and every time I navigate to /profile I get the error even though the app doesnt crush and there's no problem I just wonder what's the correct way to achieve that redirect
1 Reply
like-gold•7mo ago
Instead of using a component that needs to wait for the render to happen, consider using the
beforeLoad
callback to throw a redirect
.
Something like this - https://github.com/SeanCassiere/nv-rental-clone/blob/b9bfe8efb61d27f223803c92d7bac6c5a9f44802/src/routes/_auth/(settings)/settings._index.tsx#L5
Then it's just a matter of injects your username into router.GitHub
nv-rental-clone/src/routes/_auth/(settings)/settings._index.tsx at ...
Navotar with Tailwind and Tanstack Router and Query - SeanCassiere/nv-rental-clone