React Native gives you a small set of primitives and everything else is composed from them. View is the container - the div equivalent, and the thing you reach for by default. Text displays type, and unlike the web, text must be inside a Text component; a bare string in a View is a crash, not a silent nothing. Text also nests, and a nested one inherits the outer style, which is how you make one word bold in a sentence.
Image needs dimensions. A remote image has no intrinsic size until it has loaded, so without a width and height in its style it occupies nothing and you see an empty screen. Use expo-image in a real app for caching and transitions.
ScrollView renders every child immediately, which makes it right for a screen with a known, small amount of content and wrong for a list. Module 3 covers what to use instead. TextInput is the keyboard entry field, and is controlled the same way as on the web.
For anything tappable, use Pressable. It replaced TouchableOpacity and friends because it exposes the full set of states - pressed, hovered, focused - as a function of style, and because it supports hitSlop, which enlarges the touch target without changing the layout. A 24-pixel icon is below Apple's 44-point minimum, and hitSlop is how you fix that without drawing a bigger button.
import { View, Text, Image, ScrollView, TextInput, Pressable } from 'react-native';
import { useState } from 'react';
export function ProfileScreen() {
const [name, setName] = useState('');
return (
<ScrollView contentContainerStyle={{ padding: 16, gap: 12 }}>
{/* A remote image MUST have dimensions or it renders at zero. */}
<Image
source={{ uri: 'https://example.com/avatar.png' }}
style={{ width: 72, height: 72, borderRadius: 36 }}
/>
{/* Text nests, and the inner one inherits from the outer. */}
<Text style={{ fontSize: 16, color: '#111' }}>
Signed in as <Text style={{ fontWeight: '700' }}>{name || 'nobody'}</Text>
</Text>
<TextInput
value={name}
onChangeText={setName}
placeholder="Your name"
autoCapitalize="words"
style={{ borderWidth: 1, borderColor: '#ccc', borderRadius: 8, padding: 12 }}
/>
{/* Pressable gives you the pressed state, and hitSlop enlarges the
touch target without enlarging the thing you drew. */}
<Pressable
hitSlop={12}
onPress={() => console.log('saved')}
style={({ pressed }) => ({
backgroundColor: pressed ? '#0a5' : '#0c7',
padding: 14,
borderRadius: 10,
alignItems: 'center',
})}
>
<Text style={{ color: 'white', fontWeight: '600' }}>Save</Text>
</Pressable>
{/* A bare string here would crash. It has to be inside a Text. */}
</ScrollView>
);
}
Open this example in the editor and change it. Nothing you type is saved.