CSFrequency / react-firebase-hooks

React Hooks for Firebase.
Apache License 2.0
3.6k stars 306 forks source link

A lot of reads in the Firestore database #188

Closed 1alexvash closed 2 years ago

1alexvash commented 2 years ago

I've got a lot of reads in my app, and I'm not sure where are they coming from. If I have many routes in my app with data, and the user jumps through them back and forth, is it going to triggers reads from Firebase? Or only after refreshing the page?

chrisbianca commented 2 years ago

Hi @1alexvash, this could be for any number of reasons and without a full code example will be impossible for me to help diagnose.

If the components reading from Firestone are unmounting and remounting when switching between pages then it is possible that your app may be re-triggering reads. This will depend on the underlying Firestore caching behaviour and is not a result of anything configured within this library.

I'd suggest following up on StackOverflow as this is more of a question than an issue with the library.