T
TanStack3mo ago
rare-sapphire

layout component render while beforeLoad is still executing

repro url https://stackblitz.com/edit/tanstack-router-grysknq6?file=src%2Froutes%2F_auth%2Froute.tsx steps 1. click on logout 2. go to login link, click on login button, this logs in the user 3. after login is successful, let's visit register route ( in the _auth layout route, we have beforeLoad which checks if user is loggedin we should redirect to about page) 4. but somehow during the beforeLoad execution is going on, for some time the layout component also renders (which I was expecting not to render, since beforeLoad is still executing and once we get the user it should redirect to about page) #issue while beforeLoad of _auth layout is still executing, _auth layout renders for some time. this issue happens only first time, after that if I visit the register or login route, it doesn't happen. #expected while beforeLoad of _auth layout is still executing, pending component should render.
Aman Mavai
StackBlitz
Router Quickstart File Based Example (duplicated) - StackBlitz
Run official live example code for Router Quickstart File Based, created by Tanstack on StackBlitz
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?