import React, { Component } from 'react'
import './App.css';
import "bootstrap/dist/css/bootstrap.min.css";
import firebase from 'firebase/app';
import 'firebase/database';
import ThreadDisplay from './ThreadDisplay/components/ThreadDisplay';
class google extends Component {
constructor(props) {
super(props);
const config =
{
apiKey: "",
authDomain: "",
projectId: "",
storageBucket: "",
messagingSenderId: "",
appId: "",
measurementId: ""
};
this.app = firebase.initializeApp(config);
this.database = this.app.database();
}
render() {
return (
<ThreadDisplay database={this.database} />
);
}
}
export default google;
I have encountered a recurring issue when initializing the Firebase app only once. The error message "Firebase: Firebase App named '[DEFAULT]' already exists (app/duplicate-app)" keeps popping up. Any suggestions on how to resolve this?