mirror of
https://github.com/facebook/react.git
synced 2026-02-24 20:53:03 +00:00
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.