T
TanStack2mo ago
exotic-emerald

Running `beforeLoad`/loader functions on client only (SPA mode)

I have an authentication provider that requires authentication on the client side only. I would like to take advantage of preloading, as well as auth checks via beforeLoad, but even with ssr: false and SPA mode enabled, beforeLoad and loader functions both seem to run. This causes issues because the user isn't authenticated yet. Any way around this?
3 Replies
foreign-sapphire
foreign-sapphire2mo ago
GitHub
Release v1.125.0 · TanStack/router
Version 1.125.0 - 7/5/25, 12:36 PM Changes Feat ssr setting per route (#4565) (d728d69) by Manuel Schiller Packages @tanstack/router-core@1.125.0 @tanstack/solid-router@1.125.0 @tanstack/react-r...
exotic-emerald
exotic-emeraldOP2mo ago
SWEEEET Thank you, Manuel!

Did you find this page helpful?