dillon1000/react
Commit
Browse files Drop the _owner and _lifeCycle field on internal instances
The _owner field is unnecessary since it's reachable from _currentElement. The _lifeCycle field is unnecessary because an internal component should not even need to exist at all if it's unmounted. It should be dereferenced internally, and never exposed externally. The only case where it's important is for batching updates where we currently avoid calling performUpdateIfNecessary if it's mounted. However, this function is already only executed "if necessary" so we just make sure that it's not necessary after unmount by resetting all the pending fields.
Changed paths6 files
First-parent comparisonsrc/core/ReactComponent.js ModifiedM src/core/ReactCompositeComponent.js ModifiedM src/core/ReactUpdates.js ModifiedM src/core/__tests__/ReactComponentLifeCycle-test.js ModifiedM src/core/__tests__/ReactUpdates-test.js ModifiedM src/test/ReactDefaultPerf.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…