How to refetch firestore data?
jasan-s opened this issue · 3 comments
jasan-s commented
How to refetch firestore data?
andipaetzold commented
You can subscribe to data using useDocumentData()
. That way you will always get the current data of a document.
With useDocumentDataOnce()
you can fetch the data once. It is currently not possible to manually trigger a refresh/reload of the local data.
jasan-s commented
i see. i was looking to manually refetch.
andipaetzold commented
I see two options atm:
- Remount the component
- Subscribe to the data and instead of refetching, you always copy the current data into a separate state