title: I am trying to set other parameters from the values fetched in dropdown. But the values are not displayed. How can I display them
body: <p>I have a dropdown field that sets the name and on selecting the name it should also display the other properties like lastName, profession and so on. The name is displaying but the other values are not. How can I display the values.</p>
  <pre><code>const Val =({firstName, lastName, Profession}) =&gt;{
     const [dropdown,setDropdown] = useState(&quot;Cal&quot;)
    return(
      
      &lt;form&gt;
        
        &lt;p&gt;Name: {dropdown}&lt;/p&gt;
        
        &lt;select  onChange={(e)=&gt;setDropdown(e.target.value)}&gt;
        {Values.map((data,key) =&gt;{
          return(
            &lt;&gt;
            &lt;option key={key}&gt;{data.firstName}&lt;/option&gt;
            &lt;p&gt;LastName : {data.lastName}&lt;/p&gt;
            &lt;p&gt;Profession: {data.Profession}&lt;/p&gt;
            &lt;/&gt;
          );
          
        })}
      &lt;/select&gt;
      
      &lt;/form&gt;
     
    )
  }
  </code></pre>