Explain it simply
Mini Project Part 1: Todo App — Setup & UI, in plain language
The Todo App's UI structure splits into four components: header (title), input row (TextInput + Add button), todo list (FlatList), and todo item (checkbox + text + delete button). Clearly separating each component's responsibility now makes it much easier to plug in the state logic in Part 2.
Problem → Why → Solution
The problem — why this concept matters
Cramming everything into a single component, which turns into a mess once you wire up state in Part 2 — splitting things into logical sections matters
A common mistake
Leaving out flexDirection: 'row' on the input row, so the TextInput and button don't sit side by side
Core concept — understand how it works
Evaluate Mini Project Part 1: Todo App — Setup & UI on release devices through startup, JS/UI frame rate, memory, networking, crash recovery, permissions, signing, and store requirements—not only a debug build. Recheck New Architecture and dependency compatibility on every upgrade.
- project requirements
- components, state, and services
- tested UI
Explain the React and native-platform behavior of Mini Project Part 1: Todo App — Setup & UI
Core syntax or pattern
import { View, Text, TextInput, TouchableOpacity, FlatList, StyleSheet } from 'react-native';
const placeholderTodos = [
{ id: '1', text: 'Learn React Native', done: false },
{ id: '2', text: 'Build a Todo app', done: true },
];
export default function TodoApp() {
return (
<View style={styles.container}>
<Text style={styles.header}>My Todo App</Text>
<View style={styles.inputRow}>
<TextInput style={styles.input} placeholder="Add a todo..." />
<TouchableOpacity style={styles.addButton}>
<Text style={styles.addButtonText}>Add</Text>
</TouchableOpacity>
</View>
<FlatList
data={placeholderTodos}
keyExtractor={(item) => item.id}
renderItem={({ item }) => (
<View style={styles.todoItem}>
<Text>{item.done ? '☑️' : '☐'} {item.text}</Text>
</View>
)}
/>
</View>
);
}
const styles = StyleSheet.create({
container: { flex: 1, padding: 16 },
header: { fontSize: 24, fontWeight: 'bold', marginBottom: 16 },
inputRow: { flexDirection: 'row', marginBottom: 16 },
input: { flex: 1, borderWidth: 1, borderColor: '#ccc', borderRadius: 8, padding: 10, marginRight: 8 },
addButton: { backgroundColor: '#3b82f6', padding: 10, borderRadius: 8, justifyContent: 'center' },
addButtonText: { color: 'white', fontWeight: '600' },
todoItem: { padding: 12, borderBottomWidth: 1, borderColor: '#eee' },
});Evaluate Mini Project Part 1: Todo App — Setup & UI on release devices through startup, JS/UI frame rate, memory, networking, crash recovery, permissions, signing, and store requirements—not only a debug build. Recheck New Architecture and dependency compatibility on every upgrade.
Read the code step by step
- project requirements
import { View, Text, TextInput, TouchableOpacity, Fla...The Todo App's UI structure splits into four components: header (title), input row (TextInput + Add button), todo list (FlatList), and todo item (checkbox + text + delete button). Clearly separating each component's responsibility now makes it much easier to plug in the state logic in Part 2.
- components, state, and services
renderItem={({ item }) => (Evaluate Mini Project Part 1: Todo App — Setup & UI on release devices through startup, JS/UI frame rate, memory, networking, crash recovery, permissions, signing, and store requirements—not only a debug build. Recheck New Architecture and dependency compatibility on every upgrade.
- tested UI
});Test an original Mini Project Part 1: Todo App — Setup & UI 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.
- project requirements
- components, state, and services
- tested UI
Success
Explain the React and native-platform behavior of Mini Project Part 1: Todo App — Setup & UI
Failure
Cramming everything into a single component, which turns into a mess once you wire up state in Part 2 — splitting things into logical sections matters
Let's think about it this way for a moment
The Todo App's UI structure splits into four components: header (title), input row (TextInput + Add button), todo list (FlatList), and todo item (checkbox + text + delete button). Clearly separating each component's responsibility now makes it much easier to plug in the state logic in Part 2.
Let's connect it to a real scenario
Split the header, input row, and todo list into three sections using View, and use flexbox (flexDirection: row for the input row). At this stage just hardcode the state as a static array (placeholder data) — you'll wire up useState in Part 2. Use TouchableOpacity for the 'Add' button, the checkbox icon (☐/☑️), and the delete icon (🗑️).
Code Example
import { View, Text, TextInput, TouchableOpacity, FlatList, StyleSheet } from 'react-native';
const placeholderTodos = [
{ id: '1', text: 'Learn React Native', done: false },
{ id: '2', text: 'Build a Todo app', done: true },
];
export default function TodoApp() {
return (
<View style={styles.container}>
<Text style={styles.header}>My Todo App</Text>
<View style={styles.inputRow}>
<TextInput style={styles.input} placeholder="Add a todo..." />
<TouchableOpacity style={styles.addButton}>
<Text style={styles.addButtonText}>Add</Text>
</TouchableOpacity>
</View>
<FlatList
data={placeholderTodos}
keyExtractor={(item) => item.id}
renderItem={({ item }) => (
<View style={styles.todoItem}>
<Text>{item.done ? '☑️' : '☐'} {item.text}</Text>
</View>
)}
/>
</View>
);
}
const styles = StyleSheet.create({
container: { flex: 1, padding: 16 },
header: { fontSize: 24, fontWeight: 'bold', marginBottom: 16 },
inputRow: { flexDirection: 'row', marginBottom: 16 },
input: { flex: 1, borderWidth: 1, borderColor: '#ccc', borderRadius: 8, padding: 10, marginRight: 8 },
addButton: { backgroundColor: '#3b82f6', padding: 10, borderRadius: 8, justifyContent: 'center' },
addButtonText: { color: 'white', fontWeight: '600' },
todoItem: { padding: 12, borderBottomWidth: 1, borderColor: '#eee' },
});You'll end up with a static UI screen containing a header, an input row, and two placeholder todo items.5-Minute Try-It
Type out this UI structure yourself and run it on Expo Go — try swapping the two placeholder items for your own todo text.
A Quick Word of Caution
Pressing the Add button or a checkbox won't do anything yet at this stage (no event handlers wired up) — it becomes interactive once we add the state logic in Part 2.
Real-world usage
How to apply it in a real project
Test an original Mini Project Part 1: Todo App — Setup & UI 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 Mini Project Part 1: Todo App — Setup & UI 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, TextInput, TouchableOpacity, FlatList, StyleSheet } from 'react-native';
const placeholderTodos = [
{ id: '1', text: 'Learn React Native', done: false },
{ id: '2', text: 'Build a Todo app', done: true },
];
export default function TodoApp() {
return (
<View style={styles.container}>
<Text style={styles.header}>My Todo App</Text>
<View style={styles.inputRow}>
<TextInput style={styles.input} placeholder="Add a todo..." />
<TouchableOpacity style={styles.addButton}>
<Text style={styles.addButtonText}>Add</Text>
</TouchableOpacity>
</View>
<FlatList
data={placeholderTodos}
keyExtractor={(item) => item.id}
renderItem={({ item }) => (
<View style={styles.todoItem}>
<Text>{item.done ? '☑️' : '☐'} {item.text}</Text>
</View>
)}
/>
</View>
);
}
const styles = StyleSheet.create({
container: { flex: 1, padding: 16 },
header: { fontSize: 24, fontWeight: 'bold', marginBottom: 16 },
inputRow: { flexDirection: 'row', marginBottom: 16 },
input: { flex: 1, borderWidth: 1, borderColor: '#ccc', borderRadius: 8, padding: 10, marginRight: 8 },
addButton: { backgroundColor: '#3b82f6', padding: 10, borderRadius: 8, justifyContent: 'center' },
addButtonText: { color: 'white', fontWeight: '600' },
todoItem: { padding: 12, borderBottomWidth: 1, borderColor: '#eee' },
});Expected: Explain the React and native-platform behavior of Mini Project Part 1: Todo App — Setup & UI
Show hint
Test an original Mini Project Part 1: Todo App — Setup & UI 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
- project requirements → components, state, and services → tested UI
- Evaluate Mini Project Part 1: Todo App — Setup & UI on release devices through startup, JS/UI frame rate, memory, networking, crash recovery, permissions, signing, and store requirements—not only a debug build. Recheck New Architecture and dependency compatibility on every upgrade.
- Cramming everything into a single component, which turns into a mess once you wire up state in Part 2 — splitting things into logical sections matters
- Test an original Mini Project Part 1: Todo App — Setup & UI 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