You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Did you fix this useDatabaseListData ? I'm also getting this bug. I need to reload my browser in order to fetch the right data. Even the status is success, it doesn't show any data unless I reload the browser. Should have mentioned it in the docs.
When running in Jest/react-testing-framework, useDatabaseListData stops updating after a simple call to remove between tests clears the part of the database at the point where useDatabaseListData is referenced.
For example, when I subscribe to query(myRef, limitToFirst(1)) with useDatabaseObjectData I receive all children instead of just the first. I'm not too surprised because that hook doesn't allow Query types for the ref argument.
Activity
sojumoscow commentedon Sep 19, 2022
Did you fix this useDatabaseListData ? I'm also getting this bug. I need to reload my browser in order to fetch the right data. Even the status is success, it doesn't show any data unless I reload the browser. Should have mentioned it in the docs.
CerceJo commentedon Feb 16, 2023
When running in Jest/react-testing-framework, useDatabaseListData stops updating after a simple call to
removebetween tests clears the part of the database at the point where useDatabaseListData is referenced.dtinth commentedon Jul 24, 2023
I was hit by this bug too. I ended up re-implementing
useDatabaseListDataon top of Nano Stores, which resolved the issue for me. The code is here: https://github.com/wonderfulsoftware/ansr/blob/main/web/src/nanofire.ts (Not a complete implementation — it only supports a subset of the API that I actually use.)OsamaMSoliman commentedon Dec 23, 2023
it's exactly the same situation like stated here #497
using
useDatabaseObjectDatafor now is a nice catch, thanks @muhammadnasrmattrossman commentedon Feb 2, 2024
Unfortunately the
useDatabaseObjectDataworkaround doesn't seem to support filtering withquery()as shown here:https://github.com/FirebaseExtended/reactfire/blob/9429194d9dfed9a4b37129661d230ebcd0071e89/docs/use.md#show-a-list-of-data
For example, when I subscribe to
query(myRef, limitToFirst(1))withuseDatabaseObjectDataI receive all children instead of just the first. I'm not too surprised because that hook doesn't allowQuerytypes for the ref argument.