dillon1000/react

Commit

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.
Browse files
Changed paths4 files
First-parent comparison
M src/core/ReactDOM.js ModifiedM src/core/ReactPropTransferer.js ModifiedA src/utils/__tests__/cloneWithProps-test.js AddedA src/utils/cloneWithProps.js Added
Patch

Files changed

Rendering syntax-highlighted changes…