mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
71bb19827b
Summary: When switching between non-Fabric and Fabric screens, I believe that `initializeEventListenerForUIManagerType` is not always being called on the NativeAnimatedNodesManager if `NativeAnimatedModule.initializeLifecycleEventListenersForViewTag` is being called before the NativeAnimatedNodesManager ivar has been set. This should occur very infrequently, but logs indicate that it /does/ happen in some marginal cases. Protecting against these cases should be trivial, by using the `getNodesManager` method which is responsible for returning a nodes manager or creating a new one. The existing uses of the `NativeAnimatedNodesManager` ivar also occur on different threads and we were not protecting against this, so I'm changing it to an atomic. It's very likely that the inconsistency issues in the past were caused not by ordering errors, but thread races. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D24267118 fbshipit-source-id: 68abbff7ef3d0b2ecc9aa9977165663ad9447ab8