title: React/Redux - how can I make a copy of deeply nested state?
body: <p>I have a deeply nested redux state that looks like this:</p>
  
  <pre><code>{
      name: "Item One",
      children: [
      {
          name: "Item Two"
          children: [
              ....
          ]
      },
      {
          name: "Item Three",
          children: [
              ....
          ]
      }
      ]
  }
  </code></pre>
  
  <p>I need to make it's copy, so that I could conveniently modify it, and then replace the state with it.</p>
  
  <p>Unfortunately just using {...state} doesn't work, because all the nested children are not being copied, they still refer to the same objects. Is there a convenient workaround for this?</p>