title: TypeError: _firebase__WEBPACK_IMPORTED_MODULE_5__.default.collection is not a function
body: <p>I've had this error for a couple of days now and I don't know how to fix it. This is my first time using Firebase so I'm not really used to it. Here's code from the component that's causing the error</p>
  <pre><code>import React, {useState, useEffect} from 'react';
  import './Feed.css'
  import StoryReel from './StoryReel';
  import MessageSender from './MessageSender';
  import Post from './Post';
  import db from './firebase'
  import {onSnapshot} from 'firebase/firestore'
  
  function Feed() {
      const [posts, setPosts] = useState([])
  
      useEffect(() =&gt; {
          db.collection('posts')
              .orderBy('timestamp', 'desc')
              .onSnapshot((snapshot) =&gt;
                  setPosts(snapshot.docs.map((doc) =&gt; ({ id: doc.id, data: doc.data() })))
              );
      }, []);
  
      return (
              &lt;div className='feed'&gt;
                  &lt;StoryReel /&gt;
                  &lt;MessageSender /&gt;
  
                  {posts.map((post) =&gt; (
                      &lt;Post
                          key={post.id}
                          profilePic={post.data.profilePic}
                          message={post.data.message}
                          timestamp={post.data.timestamp}
                          username={post.data.username}
                          image={post.data.image}
                      /&gt;
                  ))}
              &lt;/div&gt;
          );
  }
  
  export default Feed;
  </code></pre>
  <p>and code from the component where I initialized Firebase in React.</p>
  <pre><code>import { initializeApp } from 'firebase/app';
  import { getAuth } from 'firebase/auth';
  import {getFirestore} from 'firebase/firestore';
  
  const firebaseConfig = {
      ...
  };
  
  const app = initializeApp(firebaseConfig);
  
  export const auth = getAuth(app);
  export default getFirestore();
  </code></pre>
  <p>Any ideas on what I need to change?</p>