ReactFire supplies hooks, context providers, and components to subscribe to Firebase auth, Firestore, and other Web SDK services in function components. It targets browser React apps, not React Native.
Overview
ReactFire simplifies using the Firebase JavaScript SDK inside React function components. Hooks such as useUser and useFirestoreCollection subscribe to authentication and realtime data, automatically unsubscribing on unmount. Other hooks expose Firestore, Remote Config, and related SDK instances from any subtree.
Initialization hooks like useInitFirestore and useInitRemoteConfig ensure settings such as persistence are applied before data access, which avoids ordering bugs across re-renders. An optional suspense mode on FirebaseAppProvider lets React handle loading by catching thrown promises instead of checking status manually in each hook result.
The library wraps the Firebase Web SDK and is incompatible with React Native or Expo; those stacks should use react-native-firebase instead. It is community-supported rather than a formally supported Firebase product.
Documentation includes quickstart material, common patterns, API reference, and an upgrade guide between major versions, plus a StackBlitz live example.
Key features
- Auth and Firestore subscription hooks
- Firebase SDK access hooks
- Init hooks before data fetch
- FirebaseAppProvider context setup
- Optional React Suspense integration
- Automatic unsubscribe on unmount
- Web React focus
- Documented v3 to v4 migration
Use cases
- Realtime Firestore UIs in React
- Firebase auth state in components
- Remote Config driven React apps
- Suspense-based Firebase loading
- Browser SPAs on Firebase backend