title: React.cloneElement: pass new children or copy props.children?
body: <p>I'm confused by the third "children" parameter of <code>React.cloneElement</code> and it's relation to <code>this.props.children</code>.</p>
  
  <p>I followed <a href="https://medium.com/@franleplant/react-higher-order-components-in-depth-cf9032ee6c3e#.kr2laetcn" rel="noreferrer">this guide</a> on higher order components and have the following code:</p>
  
  <pre><code>render() {
      const elementsTree = super.render()
  
      let myPropChange = {}
  
      /* work on newProps... */
      myPropChange.something = "nice!".
  
      const newProps = Object.assign({}, elementsTree.props, myPropChange)
  
      /* map children */
      const newChildren = React.Children.map(elementsTree.props.children, c =&gt; something(c))
  
      return React.cloneElement(elementsTree, newProps, newChildren)
  }
  </code></pre>
  
  <ul>
  <li><p>Should I put the mapped children into my <code>newProps.children</code> or should I pass them as the third parameter to <code>cloneElement</code>?</p></li>
  <li><p><code>Object.assign</code> copied the children from <code>props</code> to <code>newProps</code> anyway, should I skip them?</p></li>
  <li><p>In the guide it says</p>
  
  <blockquote>
    <p>Components don’t have a guaranty of having the full children tree resolved.</p>
  </blockquote>
  
  <p>What does that mean in my situation? That <code>this.props.children</code> is not there?</p></li>
  <li><p>Added 4th question: Why should I clone the props at all and not just directly edit them?</p></li>
  </ul>