title: cant get value of key prop in react
body: <pre><code>   const arry = [{id: 1, key: &quot;fsdfsdfs6645&quot;,sub: &quot;AB&quot;},
                   { id: 2,key: &quot;jhkhkhjk55&quot;,sub: &quot;BC&quot;},
                   {id: 3,key: &quot;iksstrrtrk55&quot;,sub: &quot;VK&quot;}
                   ];
  </code></pre>
  <blockquote>
  <p>that arry i am using here</p>
  </blockquote>
  <pre><code>import { arry } from &quot;./constant&quot;;
  
  export default function App() {
    const onChangeHandler = (e) =&gt; {
      console.log(e.target.key);
    };
  
    return (
      &lt;div className=&quot;App&quot;&gt;
        &lt;select onChange={onChangeHandler}&gt;
          {arry.map((obj) =&gt; {
            return &lt;option key={obj.key}&gt;{obj.sub}&lt;/option&gt;;
          })}
        &lt;/select&gt;
      &lt;/div&gt;
    );
  }
  </code></pre>
  <blockquote>
  <p>I was trying to access key value through onChange
  How can i access that key value?</p>
  </blockquote>
  <p>Here is Code Link <a href="https://codesandbox.io/s/frosty-newton-p78gi?file=/src/App.js:23-375" rel="nofollow noreferrer">code</a></p>