title: Onchange event in select should change others inputs field value?
body: <p>As a Begineer in a react,here what i want to do is when i select options from the react-select option the i want to dispaly that selected options label in the text input  down above on both field but got problem with here onchanges event How to change value in text field from the select options along with selected value?</p>
  <p><strong>Code</strong></p>
  <pre><code>import React, { useState } from &quot;react&quot;;
  const initialValues = [{ number: &quot;&quot;, options: &quot;&quot; }];
  const countries = [
    { id: 1, name: USA },
    { id: 2, name: Russia },
    { id: 3, name: UK },
  ];
  const Newrow = (props) =&gt; {
    const [number, setNumber] = useState(&quot;&quot;);
    const [options, setoption] = useState([]);
    const [options1, setoption1] = useState(&quot;&quot;);
    const addRow = () =&gt; {
      let _row = {
        number: &quot;&quot;,
        options: &quot;&quot;,
      };
      props.setData(_row);
    };
  
    return (
      &lt;div&gt;
        &lt;input
          type=&quot;number&quot;
          value={number}
          onChange={(e) =&gt; {
            setNumber(e.target.value);
          }}
        /&gt;
        &lt;input
          type=&quot;text&quot;
          className=&quot;input&quot;
          value={options}
          onChange={options1}
        /&gt;
        &lt;input
          type=&quot;text&quot;
          className=&quot;input&quot;
          value={options}
          onChange={options1}
        /&gt;
      &lt;/div&gt;
    );
  };
  export default function App(props) {
    const [data, setData] = useState([]);
    const addRow = (row) =&gt; {
      setData([...data, row]);
    };
    return (
      &lt;div className=&quot;App&quot;&gt;
        &lt;Select
          options={countries}
          value={{
            label: name,
            value: id,
          }}
          onChange={(e) =&gt; {
            const res = {
              id: e.value,
              name: e.label,
            };
            console.log(res);
            setoption1(res);
          }}
        &gt;&lt;/Select&gt;
  
        {[...data, ...initialValues].map((row, idx) =&gt; {
          return (
            &lt;Newrow
              setData={addRow}
              data={row}
              key={idx}
              delrow={idx}
              options1={options1}
            /&gt;
          );
        })}
        &lt;button
          type=&quot;submit&quot;
          onClick={() =&gt; addRow({ number: &quot;&quot;, options: &quot;&quot; })}
          className=&quot;btn btn-success&quot;
        &gt;
          Add
        &lt;/button&gt;
      &lt;/div&gt;
    );
  }
  </code></pre>