When root loader gets called? #11611
-
Hi team, I'm trying to find out under what conditions root loaders gets called? I somehow couldn't find anything related to this in doc. Right now I have a setup like this
When I submit the form, after the action gets invoked the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
When the browser sends a document request and the server respond with html, the root loader is called to do the SSR of the app After an action run, Remix trigger revalidation of all loaders, this can be prevented on a per route basis using the shouldRevalidate export. When the search params change (the part of the URL after If you enable the Single Fetch future flag, any client side navigation will run fetch every loader. |
Beta Was this translation helpful? Give feedback.
When the browser sends a document request and the server respond with html, the root loader is called to do the SSR of the app
After an action run, Remix trigger revalidation of all loaders, this can be prevented on a per route basis using the shouldRevalidate export.
When the search params change (the part of the URL after
?
), because any route can use them, then all loaders run again, including root.If you enable the Single Fetch future flag, any client side navigation will run fetch every loader.