T
TanStack4mo ago
xenial-black

Is it possible to keepPreviousData when using a deferred loader?

I have a case where I'm using a deferred loader, but I want to hang on to the previous data and render a loading overlay on top of my already-rendered page instead of wiping it out completely. I've searched the docs and couldn't find anything that made this seem possible.
3 Replies
ratty-blush
ratty-blush4mo ago
you're not using tanstack-query I guess? We're talking just router, right?
xenial-black
xenial-blackOP4mo ago
right, i was hoping for a router-only solution. I thought the router had a form of tanstack-query built-in so i assumed it would be straightforward but i guess not.
ratty-blush
ratty-blush4mo ago
I think the router would need to fully support react transitions to get there

Did you find this page helpful?