Explain it simply
Core Components (View, Text, Image, ScrollView), in plain language
View is a layout container (similar to HTML's <div>) — used to group and arrange child components. Text is the only component for displaying text content (text styling like font size/color has to happen inside Text). Image is for displaying pictures and accepts either a local file (require) or a remote URL (uri). ScrollView is a container that lets content scroll when it exceeds the screen height — needed whenever there's a lot of content.
Problem → Why → Solution
The problem — why this concept matters
Mixing up local file (require) and remote URL (uri object) syntax for Image source
A common mistake
Defaulting to ScrollView even for short content, causing unnecessary nesting
Core concept — understand how it works
Treat Core Components (View, Text, Image, ScrollView) as a native UI contract covering Yoga constraints, pixel density, font scaling, safe areas, the keyboard, touch targets, the accessibility tree, and iOS/Android differences—not merely screen styling syntax.
- JavaScript state
- native component and layout
- Android or iOS UI
Explain the React and native-platform behavior of Core Components (View, Text, Image, ScrollView)
Core syntax or pattern
import { View, Text, Image, ScrollView, StyleSheet } from 'react-native';
export default function ProfileScreen() {
return (
<ScrollView style={styles.container}>
<Image
source={{ uri: 'https://example.com/avatar.png' }}
style={styles.avatar}
/>
<Text style={styles.name}>Mya Mya</Text>
<Text>Software developer, learning React Native.</Text>
</ScrollView>
);
}
const styles = StyleSheet.create({
container: { flex: 1, padding: 16 },
avatar: { width: 100, height: 100, borderRadius: 50 },
name: { fontSize: 20, fontWeight: 'bold', marginTop: 8 },
});Treat Core Components (View, Text, Image, ScrollView) as a native UI contract covering Yoga constraints, pixel density, font scaling, safe areas, the keyboard, touch targets, the accessibility tree, and iOS/Android differences—not merely screen styling syntax.
Read the code step by step
- JavaScript state
import { View, Text, Image, ScrollView, StyleSheet } ...View is a layout container (similar to HTML's <div>) — used to group and arrange child components. Text is the only component for displaying text content (text styling like font size/color has to happen inside Text). Image is for displaying pictures and accepts either a local file (require) or a remote URL (uri). ScrollView is a container that lets content scroll when it exceeds the screen height — needed whenever there's a lot of content.
- native component and layout
<Text>Software developer, learning React Native.</Text>Treat Core Components (View, Text, Image, ScrollView) as a native UI contract covering Yoga constraints, pixel density, font scaling, safe areas, the keyboard, touch targets, the accessibility tree, and iOS/Android differences—not merely screen styling syntax.
- Android or iOS UI
});Test an original Core Components (View, Text, Image, ScrollView) example on Android and iOS with small and large screens, font scaling, dark mode, keyboard and screen reader use, slow/offline networking, denied permissions, and background/foreground transitions. Use DevTools, tests, and a release build where relevant.
- JavaScript state
- native component and layout
- Android or iOS UI
Success
Explain the React and native-platform behavior of Core Components (View, Text, Image, ScrollView)
Failure
Mixing up local file (require) and remote URL (uri object) syntax for Image source
Let's think about this for a moment
View is a layout container (similar to HTML's <div>) — used to group and arrange child components. Text is the only component for displaying text content (text styling like font size/color has to happen inside Text). Image is for displaying pictures and accepts either a local file (require) or a remote URL (uri). ScrollView is a container that lets content scroll when it exceeds the screen height — needed whenever there's a lot of content.
Let's connect this to a real scenario
When building a profile screen, it's common to put an Image (profile photo) and Text (name, bio) inside an outer View, with the rest of the content inside a ScrollView — since screen sizes vary across phones, if the content is long and ScrollView is missing, whatever falls below the fold simply won't be visible.
Code Example
import { View, Text, Image, ScrollView, StyleSheet } from 'react-native';
export default function ProfileScreen() {
return (
<ScrollView style={styles.container}>
<Image
source={{ uri: 'https://example.com/avatar.png' }}
style={styles.avatar}
/>
<Text style={styles.name}>Mya Mya</Text>
<Text>Software developer, learning React Native.</Text>
</ScrollView>
);
}
const styles = StyleSheet.create({
container: { flex: 1, padding: 16 },
avatar: { width: 100, height: 100, borderRadius: 50 },
name: { fontSize: 20, fontWeight: 'bold', marginTop: 8 },
});You'll be able to lay out a profile screen so the avatar image, name, and bio are scrollable.5-Minute Try-It
Combine View, Text, Image, and ScrollView to build your own simple profile screen.
A Quick Heads-Up
If you don't set width/height in Image's style, the picture might not show up at all (there's no default size) — a local file can sometimes auto-size, but a remote URI always needs an explicit width/height.
Real-world usage
How to apply it in a real project
Test an original Core Components (View, Text, Image, ScrollView) example on Android and iOS with small and large screens, font scaling, dark mode, keyboard and screen reader use, slow/offline networking, denied permissions, and background/foreground transitions. Use DevTools, tests, and a release build where relevant.
Mini challenge
Build it yourself
Test an original Core Components (View, Text, Image, ScrollView) example on Android and iOS with small and large screens, font scaling, dark mode, keyboard and screen reader use, slow/offline networking, denied permissions, and background/foreground transitions. Use DevTools, tests, and a release build where relevant.
- Rebuild the example without copying it
- Test a normal input and an edge case
- Predict the compiler or output result before running it
import { View, Text, Image, ScrollView, StyleSheet } from 'react-native';
export default function ProfileScreen() {
return (
<ScrollView style={styles.container}>
<Image
source={{ uri: 'https://example.com/avatar.png' }}
style={styles.avatar}
/>
<Text style={styles.name}>Mya Mya</Text>
<Text>Software developer, learning React Native.</Text>
</ScrollView>
);
}
const styles = StyleSheet.create({
container: { flex: 1, padding: 16 },
avatar: { width: 100, height: 100, borderRadius: 50 },
name: { fontSize: 20, fontWeight: 'bold', marginTop: 8 },
});Expected: Explain the React and native-platform behavior of Core Components (View, Text, Image, ScrollView)
Show hint
Test an original Core Components (View, Text, Image, ScrollView) example on Android and iOS with small and large screens, font scaling, dark mode, keyboard and screen reader use, slow/offline networking, denied permissions, and background/foreground transitions. Use DevTools, tests, and a release build where relevant.
Quick quiz 1 / 3
Quick quiz 2 / 3
Quick quiz 3 / 3
What to remember
- JavaScript state → native component and layout → Android or iOS UI
- Treat Core Components (View, Text, Image, ScrollView) as a native UI contract covering Yoga constraints, pixel density, font scaling, safe areas, the keyboard, touch targets, the accessibility tree, and iOS/Android differences—not merely screen styling syntax.
- Mixing up local file (require) and remote URL (uri object) syntax for Image source
- Test an original Core Components (View, Text, Image, ScrollView) example on Android and iOS with small and large screens, font scaling, dark mode, keyboard and screen reader use, slow/offline networking, denied permissions, and background/foreground transitions. Use DevTools, tests, and a release build where relevant.
React Native Documentation — React Native