TanStackT
TanStack7mo ago
4 replies
sad-indigo

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?
Was this page helpful?