11 Matching Annotations
  1. Nov 2019
    1. They called it a deep dive here:

      Originally published in the react-playbook.

    2. Oh, is it like Object.assign() then? Almost like Object.assign({}, divElement, {newProp: 'newProp'})?

      React.cloneElement(divElement, {newProp: 'newProp'})

      is a lot like

      Object.assign({}, divElement, {newProp: 'newProp'})?

    3. React.cloneElement() allows us to clone a runtime element (not the class), and apply an enhancement to it.
    1. here’s how you’d use React.Children.toArray() with React.cloneElement() to add top and bottom classes to the List component’s children.