Skip to content

Commit fcda37f

Browse files
philIipfacebook-github-bot
authored andcommitted
remove warning to tell user to set requiresMainQueueSetup (#41294)
Summary: Pull Request resolved: #41294 Changelog: [Internal] i believe this warning is outdated, i don't think having a custom initializer or exporting constants means that your module needs to be setup on main. Reviewed By: cipolleschi Differential Revision: D50919152 fbshipit-source-id: dc91af5fc88eca4f07a5f35adb888160b978cc38
1 parent 1301da8 commit fcda37f

File tree

2 files changed

+1
-27
lines changed

2 files changed

+1
-27
lines changed

packages/react-native/React/Base/RCTModuleData.mm

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -77,20 +77,6 @@ - (void)setUp
7777
!_instance && [_moduleClass instanceMethodForSelector:@selector(init)] != objectInitMethod;
7878

7979
_requiresMainQueueSetup = _hasConstantsToExport || hasCustomInit;
80-
if (_requiresMainQueueSetup) {
81-
const char *methodName = "";
82-
if (_hasConstantsToExport) {
83-
methodName = "constantsToExport";
84-
} else if (hasCustomInit) {
85-
methodName = "init";
86-
}
87-
RCTLogWarn(
88-
@"Module %@ requires main queue setup since it overrides `%s` but doesn't implement "
89-
"`requiresMainQueueSetup`. In a future release React Native will default to initializing all native modules "
90-
"on a background thread unless explicitly opted-out of.",
91-
_moduleClass,
92-
methodName);
93-
}
9480
}
9581
}
9682

packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.mm

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -879,19 +879,7 @@ - (BOOL)_requiresMainQueueSetup:(Class)moduleClass
879879
*/
880880
const BOOL hasCustomInit = [moduleClass instanceMethodForSelector:@selector(init)] != objectInitMethod;
881881

882-
BOOL requiresMainQueueSetup = hasConstantsToExport || hasCustomInit;
883-
if (requiresMainQueueSetup) {
884-
RCTLogWarn(
885-
@"Module %@ requires main queue setup since it overrides `%s` but doesn't implement "
886-
"`requiresMainQueueSetup`. In a future release React Native will default to initializing all NativeModules "
887-
"on a background thread unless explicitly opted-out of.",
888-
moduleClass,
889-
hasConstantsToExport ? "constantsToExport"
890-
: hasCustomInit ? "init"
891-
: "");
892-
}
893-
894-
return requiresMainQueueSetup;
882+
return hasConstantsToExport || hasCustomInit;
895883
}
896884

897885
- (void)installJSBindings:(facebook::jsi::Runtime &)runtime

0 commit comments

Comments
 (0)