Add missing onDismiss callback in AlertOptions

This commit is contained in:
Andrzej Zabost 2017-07-13 16:03:00 +02:00
parent 444664dd77
commit 57a4dacea6
2 changed files with 28 additions and 0 deletions

View File

@ -6343,6 +6343,8 @@ export interface AlertButton {
interface AlertOptions {
/** @platform android */
cancelable?: boolean;
/** @platform android */
onDismiss?: () => void;
}
/**

View File

@ -13,9 +13,11 @@ For a list of complete Typescript examples: check https://github.com/bgrieder/RN
import * as React from 'react'
import {
Alert,
AppState,
AppStateIOS,
BackAndroid,
Button,
Dimensions,
InteractionManager,
ListView,
@ -283,3 +285,27 @@ class TabBarTest extends React.Component {
);
}
}
class AlertTest extends React.Component {
showAlert() {
Alert.alert(
'Title',
'Message',
[
{ text: 'First button', onPress: () => {} },
{ text: 'Second button', onPress: () => {} },
{ text: 'Third button', onPress: () => {} }
],
{
cancelable: false,
onDismiss: () => {}
}
)
}
render() {
return (
<Button title='Press me' onPress={this.showAlert}/>
);
}
}