React Hook : Send data from child to parent component : <p>I'm looking for the easiest solution to pass data from a child component to his parent.</p>

<p>I've heard about using Context, pass trough properties or update props, but I don't know which one is the best solution.</p>

<p>I'm building an admin interface, with a PageComponent that contains a ChildComponent with a table where I can select multiple line. I want to send to my parent PageComponent the number of line I've selected in my ChildComponent.</p>

<p>Something like that :</p>

<p>PageComponent :</p>

<pre><code>&lt;div className="App"&gt;
  &lt;EnhancedTable /&gt;         
  &lt;h2&gt;count 0&lt;/h2&gt;
  (count should be updated from child)
&lt;/div&gt;
</code></pre>

<p>ChildComponent :    </p>

<pre><code> const EnhancedTable = () =&gt; {
     const [count, setCount] = useState(0);
     return (
       &lt;button onClick={() =&gt; setCount(count + 1)}&gt;
          Click me {count}
       &lt;/button&gt;
     )
  };
</code></pre>

<p>I'm sure it's a pretty simple thing to do, I don't want to use redux for that.</p>
