RCTAlertManager.android.js 657 B

1234567891011121314151617181920212223242526272829
  1. /**
  2. * Copyright (c) Facebook, Inc. and its affiliates.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. *
  7. * @format
  8. */
  9. 'use strict';
  10. import NativeDialogManagerAndroid from '../NativeModules/specs/NativeDialogManagerAndroid';
  11. function emptyCallback() {}
  12. module.exports = {
  13. alertWithArgs: function(args, callback) {
  14. // TODO(5998984): Polyfill it correctly with DialogManagerAndroid
  15. if (!NativeDialogManagerAndroid) {
  16. return;
  17. }
  18. NativeDialogManagerAndroid.showAlert(
  19. args,
  20. emptyCallback,
  21. callback || emptyCallback,
  22. );
  23. },
  24. };