dillon1000/react
Commit
Browse files Don't recreate instance when resuming a class component's initial mount
Recreating the class instance causes refs (and other callbacks) to close over stale instances. Instead, re-use the previous instance. componentWillMount is called again. We also call componentWillReceiveProps, to ensure that state derived from props remains in sync.
Changed paths3 files
First-parent comparisonscripts/fiber/tests-passing.txt ModifiedM src/renderers/shared/fiber/ReactFiberClassComponent.js ModifiedM src/renderers/shared/fiber/__tests__/ReactIncremental-test.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…