title: Adding field is my state is not working why?
body: <p>Does someone know why do I have <code>names</code> without my adding <code>selected</code> field???
  I'm can retrieve <code>names</code> from my api json (1) and I'm trying to modify it in order to get  my adding <code>selected</code> field (2).</p>
  <pre><code>  export default function Display() {
          ...
          const init = async () =&gt; {
              const { data } = await axios.post(&quot;&quot;).then(res =&gt; {
                  console.log(res)
                  return res.names.map((item) =&gt; {
                      return {
                          ...item,
                          types: item.types.map((t) =&gt; ({ ...t, selected: true }))
                      };
  
                  })
              })
                  .catch(err =&gt; {
                      console.log(err)
                  })
              setNames(res.data.names)
          }
  
          useEffect(() =&gt; {
              init();
          }, [])
  
          const change = (id, value, all) =&gt; {
              setStandards((prev) =&gt;
                  prev.map((i) =&gt; {... }));
      };
      return (
          &lt;&gt;
              {selectionNames.map((item) =&gt; (...))}
  
          &lt;/&gt;
      );
  }
  </code></pre>
  <p>here is my json from my api (1):</p>
  <pre><code>{
      &quot;names&quot;: [
          {
              &quot;id&quot;: 1,
              &quot;Description&quot;: &quot;descr&quot;,
              &quot;types&quot;: [
                  {
                      &quot;id&quot;: 1,
                      &quot;decription&quot;:&quot;descr1&quot;,
                  },
                  ...
          ]
          },
          ...
      ]
  }
  </code></pre>
  <p>I would like to have <code>names</code> (2):</p>
  <pre><code>{
      &quot;names&quot;: [
          {
              &quot;id&quot;: 1,
              &quot;Description&quot;: &quot;descr&quot;,
              &quot;types&quot;: [
                  {
                      &quot;id&quot;: 1,
                      &quot;decription&quot;:&quot;descr1&quot;,
                      &quot;selected&quot;:true,
                  },
                  ...
          ]
          },
          ...
      ]
  }
  </code></pre>