dillon1000/react

Commit

Clone on mount

This is the first step towards descriptors. This will start cloning the
component when it's mounted instead of mounting the first instance.

This avoids an issue where a reference to the first instance can hang around
in props. Since a mounted component gets mutated, the descriptor changes.

We don't need to clone the props object itself. Mutating the shallow props
object of a child that's passed into you is already flawed. Those cases need to
use cloneWithProps. A props object is considered shallow frozen after it leaves
the render it was created in.
Browse files
Changed paths11 files
First-parent comparison
M src/browser/ReactTextComponent.js ModifiedM src/browser/server/ReactServerRendering.js ModifiedM src/browser/ui/ReactMount.js ModifiedM src/core/ReactCompositeComponent.js ModifiedM src/core/ReactMultiChild.js ModifiedM src/core/__tests__/ReactBind-test.js ModifiedM src/core/__tests__/ReactComponentLifeCycle-test.js ModifiedM src/core/__tests__/ReactCompositeComponent-test.js ModifiedA src/core/instantiateReactComponent.js AddedM src/core/shouldUpdateReactComponent.js ModifiedM src/utils/traverseAllChildren.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…