Documentation Index
Fetch the complete documentation index at: https://resources.devweekends.com/llms.txt
Use this file to discover all available pages before exploring further.
Module Overview
Estimated Time: 4 hours | Difficulty: Beginner-Intermediate | Prerequisites: TypeScript basics
<View> is not a <div> pretending to be native — it is a real UIView on iOS and a real android.view.View on Android. The practical implication: your app inherits the platform’s native scrolling physics, touch feedback, font rendering, and accessibility features for free. But it also means you need to think about platform differences from the start, because a <Text> component renders differently on iOS (using Core Text) than on Android (using the Skia/HarfBuzz stack).
What You’ll Learn:
- View and SafeAreaView containers
- Text and typography
- Image optimization and caching
- TextInput and keyboard handling
- Pressable and touch interactions
- Platform-specific components
Component Mapping
React Native components compile to native platform components:| React Native | iOS (UIKit) | Android | Web Equivalent |
|---|---|---|---|
<View> | UIView | android.view.View | <div> |
<Text> | UILabel | TextView | <p>, <span> |
<Image> | UIImageView | ImageView | <img> |
<TextInput> | UITextField | EditText | <input> |
<ScrollView> | UIScrollView | ScrollView | <div> with overflow |
<FlatList> | UITableView | RecyclerView | Virtual list |
<Pressable> | UIButton | Button | <button> |
View Component
View is the most fundamental component—a container that supports layout, styling, touch handling, and accessibility.
View Props
SafeAreaView
Renders content within safe area boundaries (avoiding notches, home indicators):Text Component
All text must be wrapped in a<Text> component. Unlike web development where you can put text anywhere inside a <div>, React Native will throw a runtime error if you write <View>Hello</View>. This is because native platforms have dedicated text rendering systems — UILabel on iOS and TextView on Android — and React Native needs to know which rendering pipeline to use. The strict separation may feel verbose at first, but it gives you precise control over text behavior (truncation, selection, accessibility) that would be harder to achieve with bare string nodes.
Text Props Reference
iOS vs Android text rendering differences to watch for:
- Font weights: iOS supports all nine numeric weights (100-900) with the system font. Android’s Roboto supports fewer intermediate weights — requesting
fontWeight: '350'may silently snap to the nearest available weight. - Line height: iOS calculates line height from the font’s ascender and descender metrics. Android adds extra padding. The same
lineHeight: 24will produce slightly different vertical spacing on each platform. - Font scaling: Both platforms respect the user’s accessibility font size preferences by default (
allowFontScaling={true}). If your layout breaks with large text, test with accessibility font sizes enabled (iOS Settings > Display > Text Size, Android Settings > Display > Font Size). UsemaxFontSizeMultiplierto cap scaling for layout-critical text.
Image Component
Display images from local files, network URLs, or base64 data.Local Images
Network Images
ImageBackground
Image Optimization with expo-image
The built-in<Image> component from React Native has no disk caching for network images on Android and limited caching control on iOS. For production apps that display many network images (product catalogs, social feeds, user avatars), this means repeated network requests, flickering on re-renders, and wasted bandwidth. The expo-image library (or alternatives like react-native-fast-image) solves this with proper memory and disk caching, blurhash placeholders, and animated transitions.
TextInput Component
For user text input with full keyboard control. TextInput is where mobile development gets genuinely different from web: you need to manage the software keyboard explicitly. The keyboard slides up and can obscure your inputs, the return key behavior is different per keyboard type, and iOS and Android handle autofill, secure text, and autocapitalize differently. The example below demonstrates the pattern of chaining focus between inputs using refs — this is what makes a form feel native (press “Next” on the keyboard and the cursor jumps to the next field).TextInput Props Reference
Pressable Component
Modern, flexible touch handling component (recommended over TouchableOpacity).Pressable gives you a render prop pattern where both style and children can be functions that receive a { pressed } state object. This is cleaner than TouchableOpacity because you control exactly what happens visually — you are not locked into an opacity fade. On Android, you can also add the native Material Design ripple effect via android_ripple, which iOS users never see (each platform gets its expected feedback pattern).
Custom Button Component
ScrollView Component
For scrollable content:Platform-Specific Code
Hands-On Exercise: Profile Card
Build a complete profile card component:Core Component Pitfalls
Next Steps
Module 6: Styling & Theming
Learn advanced styling patterns, theming, and dark mode implementation