TanStackT
TanStack6mo ago
3 replies
sacred-rose

State management for animating a list of fetched items

I have a query that fetches a list of items.
When the query updates and has the new list of items at myQuery.data, how can I access the previous data before this latest fetch to see which items got removed so I can still display them for a moment and add CSS to add a "removed" animation? (E.g. fade out, slide out etc.)
Was this page helpful?