title: Firebase error db.collection is not a function
body: <p>I am trying to make a collection as seen in the code below. But trying to do it is giving me the error:</p>
  <pre><code>Unhandled Rejection (TypeError): _firebase_firebase_config__WEBPACK_IMPORTED_MODULE_0 __. Db.collection is not a function
  </code></pre>
  <p>My notes from where I call the DB</p>
  <pre><code>import  { db }  from &quot;../firebase/firebase-config&quot;;
  
  export const startNewNotes = () =&gt; {
    return async ( dispatch, getState ) =&gt; {
      const { uid } = getState().auth;
  
      const newNote = {
        title: '',
        body: '',
        date: new Date().getTime()
      }
  
      const doc = await db.collection(`${uid}/journal/notes`).add( newNote)
    
      console.log(doc)
    }
  }
  
  </code></pre>
  <p>This is the firebase file in which I am calling firestore, I also tried importing firebase and doing <code>firebase.firestore</code> and it doesn't let me</p>
  <pre><code>import 'firebase/firestore';
  import 'firebase/auth';
  
  import { initializeApp } from &quot;firebase/app&quot;;
  import { getFirestore } from 'firebase/firestore';
  import { GoogleAuthProvider } from 'firebase/auth';
  
  // Your web app's Firebase configuration
  const firebaseConfig = {
      apiKey: &quot;xx&quot;,
      authDomain: &quot;xx&quot;,
      projectId: &quot;xx&quot;,
      storageBucket: &quot;xx&quot;,
      messagingSenderId: &quot;xx&quot;,
      appId: &quot;xx&quot;
  };
  
  // Initialize Firebase
  initializeApp(firebaseConfig);
  
  const db = getFirestore();
  const googleAuthProvider = new GoogleAuthProvider();
  
  export{
      db,
      googleAuthProvider
  }
  </code></pre>