Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { StatusBar } from 'expo-status-bar';
- import { StyleSheet, Text, View, TouchableWithoutFeedback, TouchableOpacity, TouchableHighlight, Alert, Image, SafeAreaView, Button } from 'react-native';
- export default function App() {
- return (
- <SafeAreaView style={styles.container}>
- <Button
- title="Click Me"
- color = "red"
- onPress={() => Alert.alert("My title", "My message", [
- {text: "Yes", onPress: () => console.log("Yes")},
- {text: "No", onPress: () => console.log("No")}
- ])}
- />
- <Button
- title = "Click me also"
- color = "black"
- onPress = {() => Alert.prompt("My title", "My message", text => console.log(text))}
- />
- <StatusBar style="auto" />
- </SafeAreaView>
- );
- }
- const styles = StyleSheet.create({
- container: {
- flex: 1,
- backgroundColor: 'white',
- justifyContent: "center",
- alignItems: "center"
- },
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement