Created
August 27, 2021 09:01
-
-
Save gerrymcdonnell/b65738ab03bf021814742b66d4f1ffcb to your computer and use it in GitHub Desktop.
react native simple button press
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { StatusBar } from 'expo-status-bar'; | |
import React, {State,Component } from 'react'; | |
import { Button,StyleSheet, Text, View } from 'react-native'; | |
const HelloWorldApp = () => { | |
return ( | |
<View | |
style={{ | |
flex: 1, | |
justifyContent: "center", | |
alignItems: "center" | |
}}> | |
<Text>Hello, world!</Text> | |
<Button | |
onPress={() => { | |
alert('You tapped the button!'); | |
}} | |
title="Press Me" | |
/> | |
</View> | |
) | |
} | |
export default HelloWorldApp; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment