Skip to content

Conversation

SudoPlz
Copy link

@SudoPlz SudoPlz commented Jul 29, 2025

Cherry-pick: Fix incorrect parentTag coming from differentiator when reparenting (#50842)

Summary:
This cherry-picks upstream commit 8b00977 into our fork. It addresses a rare issue where the parentTag emitted from the differentiator is incorrect during reparenting scenarios, leading to assertion failures on Android when layout updates are involved.

This is done in hopes of fixing this issue

…acebook#50842)

Summary:
Pull Request resolved: facebook#50842

changelog: [internal]

introduce a feature flag that fixes incorrect parentTag coming from differentiator when reparenting.

The problem occurs under very specific circumstances that are covered by an integration test. The *parentTag* is also [only used on Android](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/main/jni/react/fabric/FabricMountingManager.cpp#L566) and only if layout changes as part of the update.

This diff introduces a new test specifically triggering the incorrect behaviour: `Differentiator-itest.js`. Without this fix, the test fails on following assert:           [react_native_assert(hasTag(mutation.parentTag))](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactCommon/react/renderer/mounting/stubs/StubViewTree.cpp#L245).
This diff also converts existing tests for the differentiator to parametrised tests and enables the fix.

Reviewed By: rubennorte

Differential Revision: D73428312

fbshipit-source-id: 8b00977b610a85fba8b01a50a151f30bd5321ed4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants