Skip to content

Commit dbc864c

Browse files
spredolacfacebook-github-bot
authored andcommitted
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
1 parent 44217d4 commit dbc864c

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

Diff for: React/CxxBridge/RCTCxxBridge.mm

-2
Original file line numberDiff line numberDiff line change
@@ -603,8 +603,6 @@ - (void)registerExtraModules
603603
withDispatchGroup:(dispatch_group_t)dispatchGroup
604604
lazilyDiscovered:(BOOL)lazilyDiscovered
605605
{
606-
RCTAssert(!(RCTIsMainQueue() && lazilyDiscovered), @"Lazy discovery can only happen off the Main Queue");
607-
608606
// Set up moduleData for automatically-exported modules
609607
NSArray<RCTModuleData *> *moduleDataById = [self registerModulesForClasses:modules];
610608

0 commit comments

Comments
 (0)