T
TanStack4mo ago
extended-salmon

`defaultPreload: "intent"` executes the `__root` 's `beforeLoader` on every single Link hover

How can I improve this? I don't want to run a server function on every single hover and also when accessing the link - are there any practices around this?
3 Replies
wise-white
wise-white4mo ago
you can entirely disable preloading by setting defaultPreload: false. Alternatively, you may want to leverage something like react-query so the loader doesn't rerun expensive requests every time its called
wise-white
wise-white4mo ago
extended-salmon
extended-salmonOP4mo ago
Yes, I know how to fix it using a client side solution I thought maybe there is something related to SSR that could be done here Anyway, I read your comment there Cheers! :tanstack:

Did you find this page helpful?