diff --git a/Libraries/Alert/AlertIOS.js b/Libraries/Alert/AlertIOS.js index 4a8143024a14ca..4add7cfdab92b7 100644 --- a/Libraries/Alert/AlertIOS.js +++ b/Libraries/Alert/AlertIOS.js @@ -110,6 +110,8 @@ class AlertIOS { * @static * @method alert * @param title The dialog's title. + * + * An empty string hides the title. * @param message An optional message that appears below * the dialog's title. * @param callbackOrButtons This optional argument should @@ -209,7 +211,7 @@ class AlertIOS { var callback = type; var defaultValue = message; RCTAlertManager.alertWithArgs({ - title: title || undefined, + title: title, type: 'plain-text', defaultValue, }, (id, value) => { @@ -242,7 +244,7 @@ class AlertIOS { } RCTAlertManager.alertWithArgs({ - title: title || undefined, + title: title, message: message || undefined, buttons, type: type || undefined, diff --git a/RNTester/js/AlertExample.js b/RNTester/js/AlertExample.js index 0e343453f35ba2..8e1062ab2a625b 100644 --- a/RNTester/js/AlertExample.js +++ b/RNTester/js/AlertExample.js @@ -110,6 +110,18 @@ class SimpleAlertExampleBlock extends React.Component { Alert that cannot be dismissed + Alert.alert( + '', + alertMessage, + [ + {text: 'OK', onPress: () => console.log('OK Pressed!')}, + ] + )}> + + Alert without title + + ); }