5 useful ways to use Firebase and Firestore in React app

Image for post
Image for post

In this article, we’ll check through 5 uses of Firebase that were very useful for me in some projects. Let’s do it.

Introduction

The first step is to install the packages which we need:

We can do that using ‘npm install’. ;)

Configuration

After that, we’ll create our configuration file. In my case, I just named it as ‘firebase-config.js’.

I have a little observation in the code above about “userProfile: ‘users’”. This config allows you to record the profile data in a collection automatically. it’s useful. :)
Now, we need to configure our index.js file, check the changes below:

Using

At last, we can check how we use that in some cases like:
1. Redirecting in Login

2. Using Auth:

3. Using real-time

4. Using Firestore

5. Using Profile Information

That’s all. I hope that I helped you. See you. Thanks.

Written by

Software Engineer, Full Stack Developer, Musician and Writer. edertaveira.com

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store