Skip to content

Commit

Permalink
@nocommit SampleLegacyModule playground
Browse files Browse the repository at this point in the history
Differential Revision: D44933587

fbshipit-source-id: 50b4b3a75308c9aef2d04211363c00b39f59ac86
  • Loading branch information
RSNara authored and facebook-github-bot committed May 18, 2023
1 parent fd92341 commit a41d482
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ function requireModule<T: TurboModule>(name: string): ?T {
// Backward compatibility layer during migration.
const legacyModule = NativeModules[name];
if (legacyModule != null) {
console.log('NativeModule: ' + name);
if (shouldReportLoadedModules()) {
moduleLoadHistory.NativeModules.push(name);
}
Expand All @@ -51,13 +52,15 @@ function requireModule<T: TurboModule>(name: string): ?T {
if (turboModuleProxy != null) {
const module: ?T = turboModuleProxy(name);
if (module != null) {
console.log('TurboModule: ' + name);
if (shouldReportLoadedModules()) {
moduleLoadHistory.TurboModules.push(name);
}
return module;
}
}

console.log('Not Loaded: ' + name);
if (shouldReportLoadedModules()) {
moduleLoadHistory.NotFound.push(name);
}
Expand Down

0 comments on commit a41d482

Please sign in to comment.