DEV Community

Discussion on: Using WebSockets with React Query

Collapse
 
tkdodo profile image
Dominik D

That's right - you can do it with setQueriesData. I just meant that the code I wrote in the example doesn't handle it :). If you want to go that route it's perfectly fine. The biggest advantage of invalidation is the simpler code and that you don't push data down for queries that aren't even used.