Firestore

The Firestore integration is build on redux-firestore. Auth, Storage, and RTDB interactions still go on within react-redux-firebase, while redux-firestore handles attaching listeners and updating state for Firestore.

To begin using Firestore with react-redux-firebase, make sure you have the following:

v2.0.0 or higher of react-redux-firebase

Install redux-firestore in your project using npm i --save redux-firestore@latest

Queries

Manually - Using get, or by setting listeners with setListeners/setListener (requires managing of listeners)

Automatic

firestoreConnect is a React Higher Order component that manages attaching and detaching listeners for you as the component mounts and unmounts. It is possible to roll a similar solution yourself, but can get complex when dealing with advanced situations (queries based on props, props changing, etc.)

Examples

Basic query that will attach/detach as the component passed mounts/unmounts. In this case we are setting a listener for the 'todos' collection: