Fix Firebase error on HMR with React
Posted on October 10, 2021
It's something annoying when developing a React App with Firebase as backend.
Every time you save, the HMR break the Firebase initialization, because Firebase is already initialized.
This is my quick solution:
firebase.apps.length is global and tells if there's any firebase app initialized.