title: merge two states into one in react native
body: <p>hi everyone i have a question about react native. How do I merge two states into one? if for example I have:</p>
  <pre><code>this.state.post=[{&quot;author&quot;: &quot;167635&quot;, &quot;authorName&quot;: &quot;willy il coyote&quot;, &quot;comment&quot;: undefined}, {&quot;author&quot;: &quot;167635&quot;, &quot;authorName&quot;: &quot;willy il coyote&quot;, &quot;comment&quot;: undefined}, {&quot;author&quot;: &quot;139594&quot;, &quot;authorName&quot;: &quot;ao&quot;, &quot;comment&quot;: &quot;ccc &quot;}, {&quot;author&quot;: &quot;142494&quot;, &quot;authorName&quot;: &quot;Ao&quot;, &quot;comment&quot;: &quot;Ravioli &quot;},{&quot;author&quot;: &quot;5555&quot;, &quot;authorName&quot;: &quot;Mark&quot;, &quot;comment&quot;: undefined},{&quot;author&quot;: &quot;7777&quot;, &quot;authorName&quot;: &quot;Jenny&quot;, &quot;comment&quot;: undefined},{&quot;author&quot;: &quot;2222&quot;, &quot;authorName&quot;: &quot;Heley&quot;, &quot;comment&quot;: undefined},{&quot;author&quot;: &quot;0000&quot;, &quot;authorName&quot;: &quot;Pott&quot;, &quot;comment&quot;: undefined},{&quot;author&quot;: &quot;6666&quot;, &quot;authorName&quot;: &quot;Helen&quot;, &quot;comment&quot;: undefined},{&quot;author&quot;: &quot;1234&quot;, &quot;authorName&quot;: &quot;Gess&quot;, &quot;comment&quot;: undefined}]
  this.state.post_update=[{&quot;author&quot;: &quot;uuuu&quot;, &quot;authorName&quot;: &quot;xxx&quot;, &quot;comment&quot;: undefined}, {&quot;author&quot;: &quot;777&quot;, &quot;authorName&quot;: &quot;hhhhh&quot;, &quot;comment&quot;: undefined}] 
  </code></pre>
  <p>now I want to create an array of size 10 which contains the union of post_update and post.
  But I want to show first the post_update posts and then in the remaining places I put post_update. So i want this output:</p>
  <pre><code>this.state.new_state=[{&quot;author&quot;: &quot;uuuu&quot;, &quot;authorName&quot;: &quot;xxx&quot;, &quot;comment&quot;: undefined}, {&quot;author&quot;: &quot;777&quot;, &quot;authorName&quot;: &quot;hhhhh&quot;, &quot;comment&quot;: undefined},{&quot;author&quot;: &quot;167635&quot;, &quot;authorName&quot;: &quot;willy il coyote&quot;, &quot;comment&quot;: undefined}, {&quot;author&quot;: &quot;167635&quot;, &quot;authorName&quot;: &quot;willy il coyote&quot;, &quot;comment&quot;: undefined}, {&quot;author&quot;: &quot;139594&quot;, &quot;authorName&quot;: &quot;ao&quot;, &quot;comment&quot;: &quot;ccc &quot;}, {&quot;author&quot;: &quot;142494&quot;, &quot;authorName&quot;: &quot;Ao&quot;, &quot;comment&quot;: &quot;Ravioli &quot;},{&quot;author&quot;: &quot;5555&quot;, &quot;authorName&quot;: &quot;Mark&quot;, &quot;comment&quot;: undefined},{&quot;author&quot;: &quot;7777&quot;, &quot;authorName&quot;: &quot;Jenny&quot;, &quot;comment&quot;: undefined},{&quot;author&quot;: &quot;2222&quot;, &quot;authorName&quot;: &quot;Heley&quot;, &quot;comment&quot;: undefined},{&quot;author&quot;: &quot;0000&quot;, &quot;authorName&quot;: &quot;Pott&quot;, &quot;comment&quot;: undefined}]
  </code></pre>
  <p>How can i do?</p>