Show pending component during beforeLoad-ing
Hi, does tanstack router have an easy way to display a component while beforeLoad is running? I know pendingComponent is for loaders, but in my beforeLoad i fetch an access token and do some async work and would like to display the pending component instead of just a white screen?
3 Replies
solid-orange•2y ago
Sounds like something that should be done in the loader fn
wee-brown•2y ago
This should be getting resolved soon since Tanner has made some changes and closed and issue about this problem.
https://github.com/TanStack/router/issues/1104
Once the errors in CI are fixed it'll trigger a release and the next version should have this fixed for you, using the
pendingComponent.
I'd recommend checking in a day or two for the next release to go through (for reference we are currently on 1.28.1)
Here's a link to the release tab: https://github.com/TanStack/router/releasesGitHub
pendingComponent not shown while beforeLoad is pending · Issue #1...Describe the bug pendingComponent not shown while beforeLoad is executing, but according to the docs it should. If this function returns a promise, the route will be put into a pending state and ca...
GitHub
Releases · TanStack/router
🤖 Fully typesafe Router for React (and friends) w/ built-in caching, 1st class search-param APIs, client-side cache integration and isomorphic rendering. - TanStack/router
robust-apricotOP•2y ago
No, because i dont want it to re-get the access token and run these async operations again whenever router data is invalidated. I want to run it once when the user loads the page for the first time.
Great! Awesome!