mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-01-31 05:57:33 +00:00
Add missing onDismiss callback in AlertOptions
This commit is contained in:
parent
444664dd77
commit
57a4dacea6
2
types/react-native/index.d.ts
vendored
2
types/react-native/index.d.ts
vendored
@ -6343,6 +6343,8 @@ export interface AlertButton {
|
||||
interface AlertOptions {
|
||||
/** @platform android */
|
||||
cancelable?: boolean;
|
||||
/** @platform android */
|
||||
onDismiss?: () => void;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -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}/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user