Created
April 12, 2022 21:53
-
-
Save hurali97/2c9c495266b14b00ef7101e9ecdd4850 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "MainApplicationModuleProvider.h" | |
#include <rncore.h> | |
#include <CustomModules.h> // Add this line | |
namespace facebook { | |
namespace react { | |
std::shared_ptr<TurboModule> MainApplicationModuleProvider( | |
const std::string moduleName, | |
const JavaTurboModule::InitParams ¶ms) { | |
// Here you can provide your own module provider for TurboModules coming from | |
// either your application or from external libraries. The approach to follow | |
// is similar to the following (for a library called `samplelibrary`: | |
// | |
auto module = CustomModules_ModuleProvider(moduleName, params); // Add this line | |
if (module != nullptr) { // Add this line | |
return module; // Add this line | |
} // Add this line | |
return rncore_ModuleProvider(moduleName, params); | |
} | |
} // namespace react | |
} // namespace facebook |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment