UNPKG

582 BJavaScriptView Raw
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 * @flow strict-local
8 * @format
9 */
10'use strict';
11
12/**
13 * Set up alert().
14 * You can use this module directly, or just require InitializeCore.
15 */
16if (!global.alert) {
17 global.alert = function(text) {
18 // Require Alert on demand. Requiring it too early can lead to issues
19 // with things like Platform not being fully initialized.
20 require('Alert').alert('Alert', '' + text);
21 };
22}