Loaded data disappears when using orderBy #5198
Unanswered
olemaiwald
asked this question in
Q&A
Replies: 1 comment 3 replies
-
These are not versions I am familiar with? Also, this is nothing like + at the same time "rhymes" with this problem that turned out to be something about the way the code was executed, maybe rearranging the code would somehow affect it? #5093 |
Beta Was this translation helpful? Give feedback.
3 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.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone,
I am encountering a rather interesting issue I have been trying to resolve on my own for a while now. Maybe somebody here can help me out. 🚀
For a newsfeed, I am querying posts from Firestore like this:
When the useEffect Hook is executed, the data is actually loaded, but disappears after the fraction of a second.
When logging the size of the snapshots to console, the posts get pulled in correct order. However, right after that it pulls an empty querySnapshot, overwriting the received data from the request before. The useEffect Hook seems to get triggered twice.
When I remove the orderBy in the code above, everything is working as expected. But as I would like to display posts in my feed sorted after their creation date, this does not take me very far.
Versions I am using:
Currently developing on iOS
Any help would be greatly appreciated! 😄
Beta Was this translation helpful? Give feedback.
All reactions