Skip to content

Commit 1dd7eed

Browse files
Use getConstants on main thread (#7750)
Solves ``` Main Thread Checker: UI API called on a background thread: -[UITabBarController tabBar] ``` warnings
1 parent 357397f commit 1dd7eed

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/ios/RNNBridgeModule.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,11 @@ - (instancetype)initWithCommandsHandler:(RNNCommandsHandler *)commandsHandler {
245245
}
246246

247247
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(getNavigationConstantsSync) {
248-
return [Constants getConstants];
248+
__block NSDictionary *c;
249+
RCTUnsafeExecuteOnMainQueueSync(^{
250+
c = [Constants getConstants];
251+
});
252+
return c;
249253
}
250254

251255
@end

0 commit comments

Comments
 (0)