T
TanStack3mo ago
extended-salmon

preload if hovered for at least N time

Hey, I have a big list and users scroll through it, and it's prefetching every single item pretty much. I still want to use preload there but only if the user has hovered that item for N amount of milliseconds, that at least should reduce by a lot the number of items being preloaded. I found this in the docs defaultPreloadDelay but this is will still call the prefetch so not quite the same. I guess this would be considered a feature request, what are your thoughts?
3 Replies
ratty-blush
ratty-blush3mo ago
I found this in the docs defaultPreloadDelay but this is will still call the prefetch so not quite the same
what do you mean here?
extended-salmon
extended-salmonOP3mo ago
What I'd like is to have a prop that I can pass a delay to it but if the user hover for less time than the passed time it won't trigger the preload. Currently the preload delay just delays the preloading of the route but always preloads it, just delayed if that makes sense I found router.preloadRoute so I have some hacky solution, but would be super nice to have an API in the Link component to accomplish that behaviour
genetic-orange
genetic-orange3mo ago
the preload delay just delays the preloading of the route but always preloads it, just delayed
do you have a reproduction of this behavior? This is not the intended behavior, and is not what I observe when testing it.

Did you find this page helpful?