title: Get value from <select> (dropdown) in React JS
body: <p>I want to show more input when &quot;married&quot; option is selected. I tried this.</p>
  <pre class="lang-js prettyprint-override"><code>    const [single, setsingle] = useState(false);
      const [married, setmarried] = useState(false);
      
      &lt;select class=&quot;form-select&quot; aria-label=&quot;Default select example&quot;&gt;
          &lt;option
              value={single}
              name=&quot;single&quot;
              onChange={(e) =&gt; {
                  setsingle(e.target.value);
              }}
          &gt;
              محرد
          &lt;/option&gt;
          &lt;option value={married} name=&quot;married&quot;
              onChange={(e) =&gt; {
                  setmarried(e.target.value)}}
          &gt;
              متاهل
          &lt;/option&gt;
      &lt;/select&gt;
  
      {married === &quot;married&quot; ? &lt;Wife /&gt; : null}
  </code></pre>
  <p>What did I miss?</p>