From dbc864c9cd95f9df268d85a642742e84e2360db4 Mon Sep 17 00:00:00 2001 From: Slobodan Predolac Date: Thu, 18 Oct 2018 15:21:27 -0700 Subject: [PATCH] Relax the requirement that lazy module cannot be initialized on the main thread Summary: [RN] Relax the requirement that lazy module cannot be initialized on the main thread I tried to understand the D5364734 that intoduced this, and I am not sure, but belive that asserting here is too strict. If you have a module that you want to lazily initialize, and module does not demand the main queue, it should be just a warning if you run on the main queue, not necessarily an error. Reviewed By: mmmulani Differential Revision: D10429880 fbshipit-source-id: 018c211d45b98dd8c552bf0289fe517d05e56d47 --- React/CxxBridge/RCTCxxBridge.mm | 2 -- 1 file changed, 2 deletions(-) diff --git a/React/CxxBridge/RCTCxxBridge.mm b/React/CxxBridge/RCTCxxBridge.mm index 1d8d7fad935..a15d61ea28e 100644 --- a/React/CxxBridge/RCTCxxBridge.mm +++ b/React/CxxBridge/RCTCxxBridge.mm @@ -603,8 +603,6 @@ struct RCTInstanceCallback : public InstanceCallback { withDispatchGroup:(dispatch_group_t)dispatchGroup lazilyDiscovered:(BOOL)lazilyDiscovered { - RCTAssert(!(RCTIsMainQueue() && lazilyDiscovered), @"Lazy discovery can only happen off the Main Queue"); - // Set up moduleData for automatically-exported modules NSArray *moduleDataById = [self registerModulesForClasses:modules];