Skip to content

Commit

Permalink
Relax the requirement that lazy module cannot be initialized on the m…
Browse files Browse the repository at this point in the history
…ain 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
  • Loading branch information
spredolac authored and facebook-github-bot committed Oct 18, 2018
1 parent 44217d4 commit dbc864c
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions React/CxxBridge/RCTCxxBridge.mm
Original file line number Diff line number Diff line change
Expand Up @@ -603,8 +603,6 @@ - (void)registerExtraModules
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<RCTModuleData *> *moduleDataById = [self registerModulesForClasses:modules];

Expand Down

0 comments on commit dbc864c

Please sign in to comment.