created: 2019-03-14T06:03:40.000Z

React.cloneElementとは

  • 子要素にpropsを渡すための仕組み
  • Reactではmutableを嫌うため、VDOMをimmutableに扱うための仕組み
  • 既存の子要素そのままではなく、propsが渡されたコピーを生成する

ドキュメント

The resulting element will have the original element’s props with the new props merged in shallowly. New children will replace existing children

みんなのデータ構造
[ad] みんなのデータ構造
Pat Morin, 堀江 慧 (単行本(ソフトカバー))