diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/jni/CxxSharedModuleWrapper.h b/packages/react-native/ReactAndroid/src/main/jni/react/jni/CxxSharedModuleWrapper.h deleted file mode 100644 index 8d6dd71f8c0928..00000000000000 --- a/packages/react-native/ReactAndroid/src/main/jni/react/jni/CxxSharedModuleWrapper.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -#pragma once - -#include - -#include "CxxModuleWrapperBase.h" - -namespace facebook::react { - -class CxxSharedModuleWrapper : public CxxModuleWrapperBase { - public: - std::string getName() override { - return shared_->getName(); - } - - std::unique_ptr getModule() override { - // Instead of just moving out the stored CxxModule, this creates a - // proxy which passes calls to the shared stored CxxModule. - - return std::make_unique(shared_); - } - - protected: - explicit CxxSharedModuleWrapper( - std::unique_ptr module) - : shared_(std::move(module)) {} - - std::shared_ptr shared_; -}; - -} // namespace facebook::react diff --git a/packages/react-native/ReactCommon/cxxreact/SharedProxyCxxModule.h b/packages/react-native/ReactCommon/cxxreact/SharedProxyCxxModule.h deleted file mode 100644 index c01f3791767be8..00000000000000 --- a/packages/react-native/ReactCommon/cxxreact/SharedProxyCxxModule.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -#pragma once - -#include - -#include - -namespace facebook::xplat::module { - -// Allows a Cxx-module to be shared or reused across multiple React instances -// Caveat: the setInstance call is not forwarded, so usages of getInstance -// inside your module (e.g. dispatching events) will always be nullptr. -class SharedProxyCxxModule : public CxxModule { - public: - explicit SharedProxyCxxModule(std::shared_ptr shared) - : shared_(shared) {} - - std::string getName() override { - return shared_->getName(); - } - - auto getConstants() -> std::map override { - return shared_->getConstants(); - } - - auto getMethods() -> std::vector override { - return shared_->getMethods(); - } - - private: - std::shared_ptr shared_; -}; - -} // namespace facebook::xplat::module