title: How can i set value in nested object in React?
body: <p>how can I set value from text Input to option[0].title when user input? I tried in many way and get error. Please help me to fix this issue.</p>
  <pre><code>       const [options, setOptions] = useState({
           0: {
             title: &quot;&quot;,
           },
           2: {
             title: &quot;&quot;,
            1: {
             title: &quot;&quot;,
           },    },
           3: {
             title: &quot;&quot;,
           },
           title: &quot;&quot;,   });
       
         let name, value;
       
         const handleChange = (e) =&gt; {
           name = e.target.name;
           value = e.target.value;
           setOptions({ ...options, [name]: value });   };
  
  
          return ( &lt;TextInput
                 type=&quot;text&quot;
                 name=&quot;0&quot;
                 value={options[0].title}
                 onChange={handleChange}
                 required
                 placeholder=&quot;something&quot;
                 icon=&quot;check_box_outline_blank&quot;
               /&gt; )
  </code></pre>