dillon1000/react

Commit

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.
Browse files
Changed paths3 files
First-parent comparison
M scripts/fiber/tests-passing.txt ModifiedM src/renderers/shared/fiber/ReactFiberClassComponent.js ModifiedM src/renderers/shared/fiber/__tests__/ReactIncremental-test.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…