mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Connect debugger before loading bundle (#53203)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53203 Changelog: [internal] This makes ReactHost connect the inspector immediately after creating the instance, aligned with how we do it on Android, instead of doing it as part of loading a bundle. Reviewed By: rshest Differential Revision: D79804004 fbshipit-source-id: b165520b0feb089fdfaa323413d697939c7ac794
This commit is contained in:
1 parent
e0b22e1ebf
commit
c2c2e6b7c2
1 file changed
+4
-3
@@ -240,6 +240,10 @@ void ReactHost::createReactInstance() {
|
||||
auto jsInvoker = std::make_shared<RuntimeSchedulerCallInvoker>(
|
||||
reactInstance_->getRuntimeScheduler());
|
||||
|
||||
if (inspector_ != nullptr) {
|
||||
inspector_->connectDebugger(devServerHelper_->getInspectorUrl());
|
||||
}
|
||||
|
||||
auto liveReloadCallback = [this]() { reloadReactInstance(); };
|
||||
reactInstance_->initializeRuntime(
|
||||
{
|
||||
@@ -451,9 +455,6 @@ bool ReactHost::loadScriptFromDevServer() {
|
||||
auto script = std::make_unique<JSBigStdString>(response);
|
||||
reactInstance_->loadScript(
|
||||
std::move(script), devServerHelper_->getBundleUrl());
|
||||
if (inspector_ != nullptr) {
|
||||
inspector_->connectDebugger(devServerHelper_->getInspectorUrl());
|
||||
}
|
||||
devServerHelper_->setupHMRClient();
|
||||
return true;
|
||||
} catch (...) {
|
||||
|
||||
Reference in new issue
Block a user