Untitled

mail@pastecode.io avatar
unknown
javascript
a year ago
878 B
7
Indexable
Never
import { StatusBar } from 'expo-status-bar';
import { StyleSheet, Text, View, Image, Button } from 'react-native';

export default function App() {
  const handlePress = () => {
    alert('¡Hola mundo!');
  };

  return (
    <View style={styles.container}>
      <Text style={styles.title}>Bienvenido a mi app</Text>
      <Image
        source={{ uri: 'https://docs.expo.dev/static/images/tutorial/logo.png' }}
        style={styles.image}
      />
      <Button title="Presiona aquí" onPress={handlePress} />
      <StatusBar style="auto" />
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#f0f0f0',
    alignItems: 'center',
    justifyContent: 'center',
  },
  title: {
    fontSize: 24,
    color: '#333',
    marginBottom: 20,
  },
  image: {
    width: '50%',
    aspectRatio: 1,
    marginBottom: 20,
  },
});