Youcef Madadi
Web and game development teacher
npx create-expo-app@latest
cd my-app
code .
npm run start
npm run android
Building a Simple Layout
import React from 'react';
import { View, Text, Image, StyleSheet } from 'react-native';
export default function App () {
return (
<View style={styles.container}>
<Text style={styles.title}>Hello, React Native!</Text>
<Image source={{ uri: 'https://example.com/image.png' }} style={styles.image} />
</View>
);
};
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
title: {
fontSize: 20,
fontWeight: 'bold',
},
image: {
width: 100,
height: 100,
},
});
By Youcef Madadi