Added info about a cancelable option for Alerts on Android.

Summary:
In the 8e2906ae89 commit there was implemented a cancelable option for Alerts. It wasn't clear from the docs about this option and the additional Alert method's parameter.
Closes https://github.com/facebook/react-native/pull/11292

Differential Revision: D4342707

Pulled By: lacker

fbshipit-source-id: dc243b868106e705040e77bc90d4d9b8c2dc26eb
This commit is contained in:
Kevin Lacker 2016-12-16 16:27:09 -08:00 committed by Facebook Github Bot
parent c27cc9c1ac
commit 9f3ef48f65
1 changed files with 7 additions and 1 deletions

View File

@ -52,6 +52,11 @@ type Options = {
* - Two buttons mean 'negative', 'positive' (such as 'Cancel', 'OK')
* - Three buttons mean 'neutral', 'negative', 'positive' (such as 'Later', 'Cancel', 'OK')
*
* Note that by default alerts on Android can be dismissed by clicking outside of their alert box.
* To prevent this behavior, you can provide
* an optional `options` parameter `{ cancelable: false }` to the Alert method.
*
* Example usage:
* ```
* // Works on both iOS and Android
* Alert.alert(
@ -61,7 +66,8 @@ type Options = {
* {text: 'Ask me later', onPress: () => console.log('Ask me later pressed')},
* {text: 'Cancel', onPress: () => console.log('Cancel Pressed'), style: 'cancel'},
* {text: 'OK', onPress: () => console.log('OK Pressed')},
* ]
* ],
* { cancelable: false }
* )
* ```
*/