title: Error: Uncaught (in promise) TypeError: doc is not a function at HTMLButtonElement.<anonymous>
body: <p>So, I have tried to follow The Net Ninja tutorial for my website. Here is the <a href="https://www.youtube.com/watch?v=UZqXcoqC95E&amp;list=PL4cUxeGkcC9itfjle0ji1xOZ2cjRGY_WB&amp;index=5" rel="nofollow noreferrer">tutorial link</a> that I have followed. But I have to change some codes since their firebase version is old.</p>
  <p>What I'm trying to do is to delete the row but this error came out:</p>
  <pre><code>Uncaught (in promise) TypeError: doc is not a function at HTMLButtonElement.&lt;anonymous&gt;
  </code></pre>
  <p>This is the javascript coding:</p>
  <pre><code>function renderList(doc){
          let trow = document.createElement('tr');
          let td1 = document.createElement('td');
          let td2 = document.createElement('td');
          let ControlDiv = document.createElement(&quot;div&quot;);
  
          const date = doc.data().created.toDate().toDateString();
  
          trow.setAttribute('data-id', doc.id);
          td1.textContent = doc.data().email;
          td2.textContent = date;
          ControlDiv.innerHTML = '&lt;button id=&quot;DelModBtn&quot; type=&quot;button&quot; class=&quot;btn btn-danger btn-primary my-2 ml-2&quot;&gt;Delete&lt;/button&gt;'
  
          trow.appendChild(td1);
          trow.appendChild(td2);
          trow.appendChild(ControlDiv);
          
          adminList.appendChild(trow);
  
          //deleting the data
          const deleteBtn = document.querySelector('#DelModBtn');
  
          deleteBtn.addEventListener('click', async (e) =&gt; {
              e.stopPropagation();
              let id = e.target.parentElement.getAttribute('data-id');
              await deleteDoc(doc(firestore, &quot;admin&quot;, id));
          })
      }
  </code></pre>
  <p>Can someone tell me what is wrong?</p>