Learn Mobile Apps with React Native
Interactive React Native Playground
Use the editor below to build and test a simple React Native app directly in your browser. This is embedded from Snack Expo.
Example: A Simple Button Component
import React from 'react';
import { StyleSheet, Text, View, Button, Alert } from 'react-native';
export default function App() {
return (
<View style={styles.container}>
<Text style={styles.title}>My First Mobile App</Text>
<Button
title="Press Me"
onPress={() => Alert.alert('Button Pressed!')}
/>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
title: {
fontSize: 24,
marginBottom: 20,
},
});