Reputation: 605
I run my react native application on my device (iPhone 6) and it loads fine. But when I enable remote debugging, it seems to connect fine to debugger but gets stuck on a blank screen.
As soon as I turn off remote debugging, everything loads fine.
I am on react-native 0.40.0.
Please help!
Upvotes: 10
Views: 3626
Reputation: 107
I was facing this same issue when launching a react native module from iOS native module.
Replacing below mentioned code using BUNDLE URL
if let bundleUrl = (UIApplication.shared.delegate as? AppDelegate)?.bridge?.bundleURL {
let mockData:NSDictionary = ["names":
[
["name":"Name 1",],
["name":"Name 2"]
]
]
let rootView = RCTRootView(bundleURL: bundleUrl, moduleName: "modulename", initialProperties: mockData as [NSObject : AnyObject], launchOptions: nil)
let vc = UIViewController()
vc.view = rootView
self.present(vc, animated: true, completion: nil)
with this updated code using BRIDGE
if let bridge = (UIApplication.shared.delegate as? AppDelegate)?.bridge {
let mockData:NSDictionary = ["names":
[
["name":"Name 1",],
["name":"Name 2"]
]
]
let rootView = RCTRootView(bridge: bridge, moduleName: "modulename", initialProperties: mockData as [NSObject : AnyObject])
let vc = UIViewController()
vc.view = rootView
self.present(vc, animated: true, completion: nil)
}
resolve the issues!!
Upvotes: 0
Reputation: 1204
There can be many reasons, in my case it was the cache that was creating problem. Suggested Solutions:-
gradlew clean
' in the cmdreact-native start --reset-cache
)These steps will fix the problem!
Upvotes: 1
Reputation: 21873
I overcome this effect by doing the following:
Upvotes: 0