Skip to content

Commit a26d622

Browse files
elicwhitefacebook-github-bot
authored andcommitted
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
1 parent 26912bd commit a26d622

File tree

1 file changed

+0
-22
lines changed

1 file changed

+0
-22
lines changed

Libraries/Alert/Alert.js

-22
Original file line numberDiff line numberDiff line change
@@ -111,28 +111,6 @@ class Alert {
111111
keyboardType?: string,
112112
): void {
113113
if (Platform.OS === 'ios') {
114-
if (typeof type === 'function') {
115-
console.warn(
116-
'You passed a callback function as the "type" argument to Alert.prompt(). React Native is ' +
117-
'assuming you want to use the deprecated Alert.prompt(title, defaultValue, buttons, callback) ' +
118-
'signature. The current signature is Alert.prompt(title, message, callbackOrButtons, type, defaultValue, ' +
119-
'keyboardType) and the old syntax will be removed in a future version.',
120-
);
121-
122-
const callback = type;
123-
RCTAlertManager.alertWithArgs(
124-
{
125-
title: title || '',
126-
type: 'plain-text',
127-
defaultValue: message || '',
128-
},
129-
(id, value) => {
130-
callback(value);
131-
},
132-
);
133-
return;
134-
}
135-
136114
let callbacks = [];
137115
const buttons = [];
138116
let cancelButtonKey;

0 commit comments

Comments
 (0)