title: How to send a property from an array of object from a child component to the parent component?
body: <p>I have <code>App</code>, that is the parent component and I have the <code>Child</code> component:</p>
  <p>The <code>Child</code> component gets a props called <code>items</code> so it can be reused depending on the data. It the example there is <code>data</code>, <code>data1</code> and <code>data2</code>.</p>
  <p>The thing is that I want to set a cookie from the parent component, to set the cookie I need the property <code>link</code> from <code>data2</code>, but I am already mapping <code>data2</code> in the <code>Child component</code>.</p>
  <p>What can I do to obtain the <code>value of the property link</code> in the parent component to pass it as an arguement here:</p>
  <pre><code>&lt;Child
    onClick={() =&gt;
      handleUpdate('How can I obtain here the string from link of data2?')
    }
    items={data2}
  /&gt;
  </code></pre>
  <p>This is the whole example code:</p>
  <pre><code>import * as React from 'react';
  import './style.css';
  
  const data = [
    { title: 'hey', description: 'description' },
    { title: 'hey1', description: 'description' },
    { title: 'hey2', description: 'description' },
  ];
  
  const data1 = [
    { title: 'hey', description: 'description' },
    { title: 'hey1', description: 'description' },
    { title: 'hey2', description: 'description' },
  ];
  
  const data2 = [
    { title: 'hey', link: 'link/hey' },
    { title: 'hey1', link: 'link/he1' },
    { title: 'hey2', link: 'link/he2' },
  ];
  
  export default function App() {
    const [, setCookie] = useCookie('example');
  
    const handleUpdate = (cookie) =&gt; {
      setCookie(null);
      setCookie(cookie);
    };
  
    return (
      &lt;div&gt;
        &lt;h2&gt;App - Parent&lt;/h2&gt;
        &lt;Child items={data} /&gt;
        &lt;Child items={data1} /&gt;
        &lt;Child
          onClick={() =&gt;
            handleUpdate('How can I obtain here the string from link of data2?')
          }
          items={data2}
        /&gt;
      &lt;/div&gt;
    );
  }
  
  export function Child({ items }) {
    return (
      &lt;div&gt;
        &lt;h2&gt;Child&lt;/h2&gt;
        &lt;ul&gt;
          {items.map((item) =&gt; {
            return (
              &lt;&gt;
                &lt;p&gt;{item.title}&lt;/p&gt;
                &lt;a href={item.link}&gt;Go to title&lt;/a&gt;
              &lt;/&gt;
            );
          })}
        &lt;/ul&gt;
      &lt;/div&gt;
    );
  }
  </code></pre>
  <p>Thank you!</p>