title: Filter array with hooks explanation?
body: <p>Can someone explain to me why this is not filtering toDoList</p>
  
  <pre><code>const handleDelete = e =&gt; {
      const { id } = e.currentTarget.parentElement;
      toDoList.filter(element =&gt; element._id !== id);
      setToDoList([...toDoList]);
    };
  </code></pre>
  
  <p>While this is:</p>
  
  <pre><code>const handleDelete = e =&gt; {
      const { id } = e.currentTarget.parentElement;
      setToDoList(toDoList.filter(element =&gt; element._id !== id));
    };
  </code></pre>