In setQueryData
the 'oldData' become undefined after saving any code changes
#9239
Unanswered
stefanatanasovmk
asked this question in
Q&A
Replies: 1 comment
-
UPDATE: For some reason, running Previously I would just press If someone has some similar issue maybe it's smart to run also |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hei,
So after facing challenges with fetching data, I decided to change my data fetching and handling and to use react-query for it. I like the documentation and most things just works, but there is very specific issue for which I didn't find answer anywhere.
My app is a chat app built with react-native and expo.
Scenario: I'm fetching the user conversations and listing them on the screen, the conversations are fetched in a context provider to be available troughout the app. In the provider, I also have an event listeners that are listening if a conversation have been updated, added or removed.
And then in the event listener I call this
handleConversatiOnChange
function:And in the
handleConversationOnChange
function I'm trying to change the existing updated conversation with the latest one:The problem that I'm facing is when I change something in the code and I save the changes, the
oldData
variable becomeundefined
in subsequential runs. And I cannot figure out why.I'm running the development build on the phones, the event listeners are running correctly after saving code changes, everything seems fine except that
oldData
become undefined. But if I refresh the development server, and open the development build app again on the phone,oldData
is as it should be, again.I'll appreciate if someone else have faced similar issue and how it has been solved.
Beta Was this translation helpful? Give feedback.
All reactions