Where are beforeLoad and loader executed?
Does loader always run in the server, and beforeLoad always run in client and can access to client-side api? Where can I find the environments the functions are executed in? I’m coming from Next.js so I’m a little confused when it’s not explicitly written in
2 Replies
stormy-gold•8mo ago
it depends. are you using start?
during SSR , beforeload and loader run on the server. upon subsequent navigations both run on the client
rare-sapphireOP•8mo ago
No, I’m just using Tanstack Router
Does Subsequent navigations mean when navigated to other routes via <Link /> or something like that?
Then is it common practice to use Server Functions inside loader to make sure the some piece of code always run on the server?