title: how to set state array of object without removing old state
body: <p>How to setState an array of objects in a single array without clearing the initial state.</p>
  <pre><code>const [arr,setArr]=useState([])
  
  const arr1=[{key:'a',value:'a'},{key:'b',value:'b'}]
  const arr2=[{key:'c',value:'c'},{key:'d',value:'d'}]
  
  1st cycle setState
  setArr((prevState)=&gt;(prevState.push(...arr1)) // required state  arr=[{key:'a',value:'a'},{key:'b',value:'b'}]
  
  2st cycle setState
  setArr((prevState)=&gt;(prevState.push(...arr2)) //  required state arr=[{key:'a',value:'a'},{key:'b',value:'b'},{key:'c',value:'c'},{key:'d',value:'d'}]
  
  
  </code></pre>