diff --git a/React/Base/RCTBridgeModule.h b/React/Base/RCTBridgeModule.h index b7726a061..26b2520f1 100644 --- a/React/Base/RCTBridgeModule.h +++ b/React/Base/RCTBridgeModule.h @@ -289,12 +289,6 @@ RCT_EXTERN void RCTRegisterModule(Class); \ */ + (BOOL)requiresMainQueueSetup; -/** - * Experimental. - * If YES, this module will be set up via JSI binding instead. - */ -+ (BOOL)allowJSIBinding; - /** * Injects methods into JS. Entries in this array are used in addition to any * methods defined using the macros above. This method is called only once, @@ -327,3 +321,12 @@ RCT_EXTERN void RCTRegisterModule(Class); \ - (void)partialBatchDidFlush; @end + +/** + * Experimental. + * A protocol to declare that a class supports JSI-bound NativeModule. + * This may be removed in the future. + */ +@protocol RCTJSINativeModule + +@end diff --git a/React/CxxBridge/RCTCxxBridge.mm b/React/CxxBridge/RCTCxxBridge.mm index 22777864a..78b2d68d0 100644 --- a/React/CxxBridge/RCTCxxBridge.mm +++ b/React/CxxBridge/RCTCxxBridge.mm @@ -549,7 +549,7 @@ struct RCTInstanceCallback : public InstanceCallback { NSArray *moduleClassesCopy = [moduleClasses copy]; NSMutableArray *moduleDataByID = [NSMutableArray arrayWithCapacity:moduleClassesCopy.count]; for (Class moduleClass in moduleClassesCopy) { - if (RCTJSINativeModuleEnabled() && [moduleClass respondsToSelector:@selector(allowJSIBinding)] && [moduleClass allowJSIBinding]) { + if (RCTJSINativeModuleEnabled() && [moduleClass conformsToProtocol:@protocol(RCTJSINativeModule)]) { continue; } NSString *moduleName = RCTBridgeModuleNameForClass(moduleClass);