mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
bec5b8711f
Summary: In the legacy system, when NativeModules are supposed to be initialized on the main queue, we do the following synchronously on the main thread: 1. Done: Attach bridge on main queue 2. Register the NativeModule for frame updates on main queue 3. Post Notification that NativeModule was created on main queue 4. Attach methodQueue on main queue 5. Call new on main queue `[RCTModuleData instance]` is the entrypoint for all of this logic. We probably shouldn't synchronously execute all this initialization on the main queue, because it can lead to deadlocks down the road. Therefore, this diff makes it so that we still call `new` on the same thread. However, we do all other initialization in the main thread, if that's required. Changelog: [iOS][Fixed] TurboModule initialization on the main queue Reviewed By: PeteTheHeat Differential Revision: D17867583 fbshipit-source-id: a88412ee1e3d93a4f9b5ab0b4dd8fc5213fa91f8