My app needs to implement Firebase authentication and get data from the realtime database for each user (structured as /users/{uid}/{data}). However I have not come across good information on how to access the data for each screen of my app. The options that I can't decide between are:
- use the on listener from react-native-firebase in the root of the app to push the updated state to redux each time a user property updates
- push a property value to both firebase and redux in each component when it needs to update a value
- use redux only for state management and push data to firebase real time database when needed (for data redundency and iot devices)
I have avoided using firebase by itself to manage state as fetching each property for a component is rather slow, consumes a lot of bandwidth and I want the app to work for users that do not have an internet connection.
I have looked at other libraries like react-redux-firebase for state management but they seem outdated and I'm wondering what are the current best solutions for state management for an online focused app that doesn't rely exclusively on firebase.