Skip to content

Instantly share code, notes, and snippets.

@hurali97
Created April 12, 2022 21:53
Show Gist options
  • Save hurali97/2c9c495266b14b00ef7101e9ecdd4850 to your computer and use it in GitHub Desktop.
Save hurali97/2c9c495266b14b00ef7101e9ecdd4850 to your computer and use it in GitHub Desktop.
#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 &params) {
// 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