Skip to content
Permalink
Browse files
Remove deprecated support for Alert.prompt with type as Callback
Summary:
This functionality was deprecated in [this commit](e2bd7db) on Feb 12th, 2019, originall in 0.59.0

Changelog:
[Breaking][General] Alert: Remove deprecated support for Alert.prompt with type as Callback (deprecated in 0.59)

Reviewed By: cpojer

Differential Revision: D19762618

fbshipit-source-id: a8edb6045bbc57d56e75fd281e602f5370ba1810
  • Loading branch information
TheSavior authored and facebook-github-bot committed Feb 6, 2020
1 parent 26912bd commit a26d622d04451d6872eed2491e5d3f7d4689824d
Showing 1 changed file with 0 additions and 22 deletions.
@@ -111,28 +111,6 @@ class Alert {
keyboardType?: string,
): void {
if (Platform.OS === 'ios') {
if (typeof type === 'function') {
console.warn(
'You passed a callback function as the "type" argument to Alert.prompt(). React Native is ' +
'assuming you want to use the deprecated Alert.prompt(title, defaultValue, buttons, callback) ' +
'signature. The current signature is Alert.prompt(title, message, callbackOrButtons, type, defaultValue, ' +
'keyboardType) and the old syntax will be removed in a future version.',
);

const callback = type;
RCTAlertManager.alertWithArgs(
{
title: title || '',
type: 'plain-text',
defaultValue: message || '',
},
(id, value) => {
callback(value);
},
);
return;
}
let callbacks = [];
const buttons = [];
let cancelButtonKey;

0 comments on commit a26d622

Please sign in to comment.