How to solve RCTBridge required dispatch_sync to load warning on iOS for React Native

Published on Sep 4, 2021

1 min read

REACT-NATIVE

The RCTBridge required dispatch_sync to load RCTDevLoadingView has become a common occurence when developing React Native apps with version 0.64 and 0.65.

ss1

I came across this warning when installing packages like:

  • react-native-bootsplash
  • react-navigation v6

Recently, I came across an open issue on github.com/facebook/react-native that contains the following resolution for this.

Open the file ./ios/AppName/AppDelegate.m. First, add the following just after the import statement #import "AppDelegate.h":

1#import "AppDelegate.h"
2
3// Add this
4#if RCT_DEV
5#import <React/RCTDevLoadingView.h>
6#endif
7// ---------------

Then, in the @implementation AppDelegate, before RCTRootView, add the following:

1 #if RCT_DEV
2 [bridge moduleForClass:[RCTDevLoadingView class]];
3 #endif
4
5 RCTRootView *rootView ...

Build the iOS app again by running:

yarn run ios
# or
npx react-native run-ios

The warning will be gone now.

Share this article on Twitter


More Posts

Browse all posts

Join 1300+ devs & subscribe to my newsletter!

NEWSLETTER

🔗 Subscribe on Revue

AMAN MITTAL author

Software Developer and Technical Writer since 2017. Loves learning and writing about Node.js, React, React Native & Expo. Previously, a Developer Advocate at Draftbit.


Copyright ©  2019-2022 Aman Mittal · All Rights Reserved.