Skip to content

Commit 7c00562

Browse files
logandanielsfacebook-github-bot
authored andcommitted
Back out "[TM] Check TurboModules first in TurboModuleRegistry"
Summary: `hg backout D15703655` possible cause of S180976 Reviewed By: shergin Differential Revision: D15831550 fbshipit-source-id: 9080222c51e39f4432f4c081a8863dea2dcadec3
1 parent 616864a commit 7c00562

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

Libraries/TurboModule/TurboModuleRegistry.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,17 @@ import invariant from 'invariant';
1717
const turboModuleProxy = global.__turboModuleProxy;
1818

1919
export function get<T: TurboModule>(name: string): ?T {
20-
if (turboModuleProxy != null) {
21-
const module: ?T = turboModuleProxy(name);
22-
if (module != null) {
23-
return module;
24-
}
25-
}
26-
2720
// Backward compatibility layer during migration.
2821
const legacyModule = NativeModules[name];
2922
if (legacyModule != null) {
3023
return ((legacyModule: any): T);
3124
}
3225

26+
if (turboModuleProxy != null) {
27+
const module: ?T = turboModuleProxy(name);
28+
return module;
29+
}
30+
3331
return null;
3432
}
3533

0 commit comments

Comments
 (0)