DEV Community

Discussion on: React & Firebase: Add Firebase to a React App

Collapse
 
inoumen profile image
Ihor • Edited

That is not working in v. 9.0.1. So to make it work, use this:

On the first step, do

import { initializeApp } from 'firebase/app'; - instead of importing just 'firebase' as a default import

And to check is the app initialized, do

import { getApps } from 'firebase/app'; - instead of importing just 'firebase'
const firebaseApp = getApps()[0]; - instead of firebase.apps[0]

The rest remain the same.

Collapse
 
farazamiruddin profile image
faraz ahmad

Thank you! The API has changed a lot with the new release. Planning on making an update soon.