title: Delete React items
body: <p>I have code that outlines all the list items on the page. And each list item has a button to delete it. But after reloading the page, all list items are restored. How to avoid recovery after reboot?</p>
  <pre><code>import React, {useState} from &quot;react&quot;;
  
  export let List = () =&gt; {
  
  let [deletedTasks, setDeletedTasks] = useState([]);
  let [tasks, setTasks] = useState([
  { id: 1, title: 'title 1'},
  { id: 2, title: 'title 2'},
  { id: 3, title: 'title 3'}
  ]
  
  let deleteElements = (id) =&gt; {
      const task = tasks.find((e) =&gt; e.id === id);
      setDeletedTasks((p) =&gt; [...p, task]);
      setTasks((p) =&gt; p.filter((e) =&gt; e.id !== id));
  }
  
  return (&lt;div&gt;
      &lt;div&gt;
          &lt;ul&gt;{tasks.map(el =&gt;&lt;li&gt;{el.title}
              &lt;button onClick={() =&gt; deleteElements(el.id)}&gt;Delete elements&lt;/button&gt;
          &lt;/li&gt;)}&lt;/ul&gt;
      &lt;/div&gt;
  &lt;/div&gt;)
  }
  </code></pre>