Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save gerrymcdonnell/b65738ab03bf021814742b66d4f1ffcb to your computer and use it in GitHub Desktop.
Save gerrymcdonnell/b65738ab03bf021814742b66d4f1ffcb to your computer and use it in GitHub Desktop.
react native simple button press
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