-
Thank you for building RTK(Q)! Really enjoying it so far. Today I ran into what I found strange behavior where I noticed that the
After a long debug session, I realized that this is Intended behavior. It is explained in the docs but that was not immediately obvious to me (maybe I didn't read properly). I am looking for the best way to disable this behavior or differentiate if data comes from different query variables. My use case is a But also I'd like to disable the behavior that data from different query variables is displayed. Because it kind of looks like the UI is lagging behind when navigating between urls. I can't figure out if there's a way to differentiate between these two cases with the current flags returned from the Coming from For reference here are 2 codesandboxes with the behaviors of RTKQ and react-query: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The easiest way of achieving that would simply be to reset your component's identity - after all you probably also don't want to keep other local state around for it. That could be done just by adding a Another point would be just to use a selector
Generally, this has been asked for a few times (e.g. #1339) and we'll probably add a boolean flag on |
Beta Was this translation helpful? Give feedback.
The easiest way of achieving that would simply be to reset your component's identity - after all you probably also don't want to keep other local state around for it.
That could be done just by adding a
key
prop:<PersonLoader id={selectedPerson} key={selectedPerson} />
.Another point would be just to use a selector
Generally, this has been asked for a few times (e.g. #1339) and we'll probably add a boolean flag on
result
in a future version, but as of right now, thi…