Reactfire

Reactfire is the semi-official React library for Firebase. The API of Reactfire is fundamental to the Next.js Firebase SaaS Starter kit.

The Next.js Firebase kit uses ReactFire extensively throughout the kit. ReactFire is a library that allows you to bind Firebase data to React components. This allows you to easily display data from Firebase in your React components.

For the majority of use cases, you will be using Reactfire's React hooks to interact with your Firebase data, as we've seen in the previous sections.

These include:

  • useFirestore: this will allow you to interact with your Firestore database
  • useAuth: this will allow you to interact with your Firebase authentication
  • useStorage: this will allow you to interact with your Firebase storage (you are required to add the FirebaseStorageProvider above your component tree for this to work)

To use the Next.js Firebase effectively, it's extremely important to understand how Reactfire works, so please do familiarise yourself with the ReactFire documentation.


Subscribe to our Newsletter
Get the latest updates about React, Remix, Next.js, Firebase, Supabase and Tailwind CSS