UNPKG

react-native

Version:

A framework for building native apps using React

36 lines (30 loc) 1.01 kB
/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow strict-local * @format */ import type {Args} from './NativeAlertManager'; import NativeDialogManagerAndroid from '../NativeModules/specs/NativeDialogManagerAndroid'; function emptyCallback() {} export function alertWithArgs( args: Args, callback: (id: number, value: string) => void, ) { // TODO(5998984): Polyfill it correctly with DialogManagerAndroid if (!NativeDialogManagerAndroid) { return; } NativeDialogManagerAndroid.showAlert( // $FlowFixMe[incompatible-type] - Mismatched platform interfaces. args, emptyCallback, // $FlowFixMe[incompatible-type] - Mismatched platform interfaces. /* $FlowFixMe[constant-condition] Error discovered during Constant * Condition roll out. See https://fburl.com/workplace/1v97vimq. */ callback || emptyCallback, ); }