import * as React from 'react'; import { Alert, Platform } from 'react-native'; import Button from '../components/Button'; import { Page, Section } from '../components/Page'; export default function AlertExample() { const showPrompt = () => { Alert.prompt('Enter a value', undefined, text => console.log(`You entered ${text}`)); }; const showAlert = () => { Alert.alert('Alert Title', 'My Alert Msg', [ { 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') }, ]); }; return (
); } AlertExample.navigationOptions = { title: 'Alert', };