mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
68150914f5
Summary: Before this change, all methods `ShadowNode::getComponentHandle()` and `ShadowNode::getComponentHandle()` returned the values directly from a `ComponentDescriptor` (via `ShadowNodeFamily`). Now, we store/cache those values in ShadowNodeFamily object (and ShadowNode's methods use that). We need that to ensure that calling those methods doesn't access the `ComponentDescriptor` object because it's difficult to guarantee that this object overlives all `ShadowNode`s. This is especially important when we build `ShadowView`s from `ShadowNode`s: this might happen way after the code is already deallocated and the only living objects are MountingTransactionCoordinator and essentially two pointers to root nodes of before and after trees (that still needs to be mounted). This diff introduces no actual changes in the ownership model. Changelog: [Internal] Fabric-specific internal change. Reviewed By: mdvacca Differential Revision: D18290024 fbshipit-source-id: 4135a277515a84b053fe0d0dde48fba59bf2aae3