Skip to content

Commit 9ebdf74

Browse files
p-sunfacebook-github-bot
authored andcommittedMar 27, 2021
Remove Unable to get TurboModule for DialogManagerAndroid warning for iOS
Summary: The import of DialogManagerAndroid in [Alert.js](https://fburl.com/diffusion/n57e4l50) causes "Unable to get iOS TurboModule for DialogManagerAndroid" log. Don't call ` TurboModuleRegistry.get` on DialogManagerAndroid when the Platform is iOS. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D27376204 fbshipit-source-id: 948da5c162100ffe196d5e0a54dc8b85659239ae
1 parent 3c4363d commit 9ebdf74

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed
 

‎Libraries/Alert/Alert.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99
*/
1010

1111
import Platform from '../Utilities/Platform';
12-
import NativeDialogManagerAndroid, {
13-
type DialogOptions,
14-
} from '../NativeModules/specs/NativeDialogManagerAndroid';
12+
import type {DialogOptions} from '../NativeModules/specs/NativeDialogManagerAndroid';
1513
import RCTAlertManager from './RCTAlertManager';
1614

1715
export type AlertType =
@@ -48,6 +46,8 @@ class Alert {
4846
if (Platform.OS === 'ios') {
4947
Alert.prompt(title, message, buttons, 'default');
5048
} else if (Platform.OS === 'android') {
49+
const NativeDialogManagerAndroid = require('../NativeModules/specs/NativeDialogManagerAndroid')
50+
.default;
5151
if (!NativeDialogManagerAndroid) {
5252
return;
5353
}

‎Libraries/TurboModule/TurboModuleRegistry.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function requireModule<T: TurboModule>(name: string): ?T {
2828
const module: ?T = turboModuleProxy(name);
2929
if (module == null) {
3030
// Common fixes: Verify the TurboModule is registered in the native binary, and adopts the code generated type-safe Spec base class.
31-
// May be caused by importing legacy modules in JS.
31+
// Safe to ignore when caused by importing legacy modules that are unused.
3232
console.info(
3333
'Unable to get TurboModule for ' +
3434
name +

0 commit comments

Comments
 (0)
Please sign in to comment.