Skip to content

Commit

Permalink
Remove deprecated support for Alert.prompt with type as Callback
Browse files Browse the repository at this point in the history
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
elicwhite authored and facebook-github-bot committed Feb 6, 2020
1 parent 26912bd commit a26d622
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions Libraries/Alert/Alert.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a26d622

Please sign in to comment.