title: React hooks. How to pass args from one element to other
body: <p>Salute. I'am moving simple todoApp from Components to Hooks. So here is the question: I am creating a deleter from an array of todos in my App.js(highest one) file and pass it to another component.</p>
  
  <p>So here it is:</p>
  
  <pre><code>const App = () =&gt; {
    const [todoData, onDeleted] = useState([
      { label: "Drink Coffee", important: false, id: 1 },
      { label: "Make Awesome App", important: true, id: 2 },
      { label: "Have a lunch", important: false, id: 3 }
    ]);
  
    const deleteHandler = id =&gt; {
      todoData.filter(obj =&gt; obj.id !== id);
    };
    return(
        &lt;TodoList todos={todoData} onDeleted={onDeleted(id =&gt; deleteHandler(id)))} /&gt;
  )
  </code></pre>
  
  <p>In todo-list.js i do this.</p>
  
  <pre><code>      &lt;li key={id} className="list-group-item"&gt;
          &lt;TodoListItem {...itemProps} onDeleted={() =&gt; onDeleted()} /&gt;
        &lt;/li&gt;
  </code></pre>
  
  <p>In todo-list-item.js i do this:</p>
  
  <pre><code>&lt;button
          type="button"
          className="btn btn-outline-danger btn-sm float-right"
          onClick={onDeleted}
        &gt;
  </code></pre>
  
  <p>So... I don't really how to properly pass an id of an element to delete handler, also I get 'TypeError: Cannot read property 'filter' of undefined'. What am I doing wrong and how can i fix it?</p>