dillon1000/react
Commit
Browse files cloneWithProps()
what if you want to change the props of a child? This is my first attempt which lets you clone a child and transfer some custom props to it. There is a fundamental issue with refs here. Since the component is cloned the ref will be broken. And since we can clone multiple times, it might not make sense to support repairing refs.
Changed paths4 files
First-parent comparisonsrc/core/ReactDOM.js ModifiedM src/core/ReactPropTransferer.js ModifiedA src/utils/__tests__/cloneWithProps-test.js AddedA src/utils/cloneWithProps.js AddedPatch
Files changed
Rendering syntax-highlighted changes…