diff --git a/packages/react-native/ReactCommon/hermes/executor/HermesExecutorFactory.cpp b/packages/react-native/ReactCommon/hermes/executor/HermesExecutorFactory.cpp index 8ee40df6785a6e..e7c8886fa07322 100644 --- a/packages/react-native/ReactCommon/hermes/executor/HermesExecutorFactory.cpp +++ b/packages/react-native/ReactCommon/hermes/executor/HermesExecutorFactory.cpp @@ -13,6 +13,7 @@ #include #include +#include #include #include @@ -258,7 +259,9 @@ HermesExecutor::HermesExecutor( jsinspector_modern::RuntimeTargetDelegate& HermesExecutor::getRuntimeTargetDelegate() { if (!targetDelegate_) { - targetDelegate_.emplace(hermesRuntime_); + targetDelegate_ = + std::make_unique( + hermesRuntime_); } return *targetDelegate_; } diff --git a/packages/react-native/ReactCommon/hermes/executor/HermesExecutorFactory.h b/packages/react-native/ReactCommon/hermes/executor/HermesExecutorFactory.h index ea370876d7af42..89fce4d04c469c 100644 --- a/packages/react-native/ReactCommon/hermes/executor/HermesExecutorFactory.h +++ b/packages/react-native/ReactCommon/hermes/executor/HermesExecutorFactory.h @@ -8,7 +8,6 @@ #pragma once #include -#include #include #include @@ -62,8 +61,7 @@ class HermesExecutor : public JSIExecutor { JSIScopedTimeoutInvoker timeoutInvoker_; std::shared_ptr runtime_; std::shared_ptr hermesRuntime_; - std::optional - targetDelegate_; + std::unique_ptr targetDelegate_; }; } // namespace facebook::react