mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary: During investigation of impact of PR https://github.com/facebook/react-native/pull/38706 on `reanimated` I found out that when: - state reconciliation is turned on - `progressState` in `ShadowTree::tryCommit` quite often returns a new pointer to updated shadow tree - above happened due to `newState->getMostRecentStateIfObsolete()` returning precisely the same ptr as `newState` in `progressState` - this is caused by calling `ShadowNodeFamily::setMostRecentState` with the same state as currently held and marking those states as obsolete This PR adds additional check whether `ShadowNodeFamily::setMostRecentState` is called with the same `state` as currently set and skips setting obsolete flag if that happens. ## Changelog: [INTERNAL][FIXED] Setting the same most recent state for ShadowNodeFamily, doesn't mark it as obsolete Pull Request resolved: https://github.com/facebook/react-native/pull/39095 Test Plan: None Reviewed By: cipolleschi Differential Revision: D48526395 Pulled By: sammy-SC fbshipit-source-id: f77cea2364611a42a3363285b4732f33aae8a0a7