title: how to update a specific [KEY] : [VALUE] of Array of object stored as State variable
body: <p>I have a state varible named returnValuesArr.
  <a href="https://i.stack.imgur.com/Wqpub.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Wqpub.png" alt="this is picture of console for this state variable, as you can see it is an array of objects"></a></p>
  
  <p>Now i want to update 'Value' key of the first object after making an API call.
  I tried this.</p>
  
  <pre><code>const getReturns = async () =&gt; {
          const res1 = await axios.get(`${BASE_URLS.signupBaseUrl}/mutual-funds/nav/${filteredList.data[0].quandl_code}`).catch(err =&gt; {throw err})
          setReturnValueArr({...returnValuesArr, returnValuesArr:  {...returnValuesArr.find(item =&gt; item.code === res1.data.data.dataset.dataset_code), [value] : res1.data.data.returns }})
  
          return;
      }
  </code></pre>
  
  <p>but it shows no effect on my state variable..it is same as before.
  Can anyone please help what i am doing wrong. or is there any syntactical mistake</p>