Skip to content
Discussion options

You must be logged in to vote

well what did you do in the optimistic update?

sorry, this back and forth is pointless and exhausting, and it's usually the reason why I require a runnable codesandbox reproduction to investigate issues.

Conceptually, here is what happens:

React Query has a document cache (not a normalized cache); it's an in-memory JS map where the key is the QueryKey. If you change the key, you create a separate entry in the Cache.

That means, if you have 3 filters, and you switch between the three, you have three cache entries, each having their own data. With filters, that means you'll likely have duplicate data in the various cache entries (which is fine, that's how it's designed to work).

If you now …

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
5 replies
@cuongle-hdwebsoft
Comment options

@TkDodo
Comment options

@cuongle-hdwebsoft
Comment options

@TkDodo
Comment options

Answer selected by cuongle-hdwebsoft
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #5624 on June 25, 2023 17:26.