From 9b7f189d7e519eb281b7db04a174006f6e7320d1 Mon Sep 17 00:00:00 2001 From: zm00622 <56224858+zm00622@users.noreply.github.com> Date: Sat, 4 Sep 2021 10:35:18 -0400 Subject: [PATCH] Resolving attempted import error I send many thanks to the repo owner. Thank you for pushing the world forward! --- App.js | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 App.js diff --git a/App.js b/App.js new file mode 100644 index 0000000..dd839e3 --- /dev/null +++ b/App.js @@ -0,0 +1,61 @@ +import React, { Component } from 'react'; +import withFirebaseAuth from 'react-with-firebase-auth' + +// Removing these imports with the pull request + +// import firebase from 'firebase/app'; +// import 'firebase/auth'; + +// With the above imports, I received the following error +// Attempted import error: 'initializeApp' is not exported from 'firebase/app' (imported as 'firebase'). + +// By then adding these imports, I successfully restored compatability +import firebase from 'firebase/compat/app'; +import 'firebase/compat/auth'; + +import firebaseConfig from './firebaseConfig'; +import logo from './logo.svg'; +import './App.css'; + + +const firebaseApp = firebase.initializeApp(firebaseConfig); + +class App extends Component { + render() { + const { + user, + signOut, + signInWithGoogle, + } = this.props; + + return ( +
Hello, {user.displayName}
+ :Please sign in.
+ } + + { + user + ? + : + } +