Explain it simply
Mini Project Part 3: Todo App — Polish & Navigation, in plain language
The empty state — showing 'No todos yet!' when the todo list is empty — is an important piece of UX polish, and you can implement it with FlatList's ListEmptyComponent prop. Pressing a todo item navigates to a Detail screen (using React Navigation from earlier chapters), where you can show the todo's full details or an edit screen.
Problem → Why → Solution
The problem — why this concept matters
Nesting the delete button inside the outer TouchableOpacity (the item press), so tapping the delete icon also triggers the item's detail navigation right away (an event propagation issue — you may need stopPropagation logic)
A common mistake
Leaving the empty state unimplemented so users just see a blank screen — this can be confusing
Core concept — understand how it works
Evaluate Mini Project Part 3: Todo App — Polish & Navigation 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 3: Todo App — Polish & Navigation
Core syntax or pattern
<FlatList
data={todos}
keyExtractor={(item) => item.id}
ListEmptyComponent={
<Text style={styles.emptyText}>No todos yet! Add one above 👆</Text>
}
renderItem={({ item }) => (
<TouchableOpacity
style={styles.todoItem}
onPress={() => navigation.navigate('TodoDetail', { todoId: item.id })}
>
<Text>{item.done ? '☑️' : '☐'} {item.text}</Text>
<TouchableOpacity onPress={() => deleteTodo(item.id)}>
<Text>🗑️</Text>
</TouchableOpacity>
</TouchableOpacity>
)}
/>Evaluate Mini Project Part 3: Todo App — Polish & Navigation 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
<FlatListThe empty state — showing 'No todos yet!' when the todo list is empty — is an important piece of UX polish, and you can implement it with FlatList's ListEmptyComponent prop. Pressing a todo item navigates to a Detail screen (using React Navigation from earlier chapters), where you can show the todo's full details or an edit screen.
- components, state, and services
onPress={() => navigation.navigate('TodoDetail', { to...Evaluate Mini Project Part 3: Todo App — Polish & Navigation 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 3: Todo App — Polish & Navigation 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 3: Todo App — Polish & Navigation
Failure
Nesting the delete button inside the outer TouchableOpacity (the item press), so tapping the delete icon also triggers the item's detail navigation right away (an event propagation issue — you may need stopPropagation logic)
Let's think about it this way for a moment
The empty state — showing 'No todos yet!' when the todo list is empty — is an important piece of UX polish, and you can implement it with FlatList's ListEmptyComponent prop. Pressing a todo item navigates to a Detail screen (using React Navigation from earlier chapters), where you can show the todo's full details or an edit screen.
Let's connect it to a real scenario
Add FlatList's ListEmptyComponent={<Text>No todos yet! Add one above.</Text>} and it'll only show up when the todos array is empty. Wire up each todo item's onPress with navigation.navigate('TodoDetail', { todoId: item.id }), then in the TodoDetail screen look up the todo using route.params.todoId (React Navigation's route params pattern).
Code Example
<FlatList
data={todos}
keyExtractor={(item) => item.id}
ListEmptyComponent={
<Text style={styles.emptyText}>No todos yet! Add one above 👆</Text>
}
renderItem={({ item }) => (
<TouchableOpacity
style={styles.todoItem}
onPress={() => navigation.navigate('TodoDetail', { todoId: item.id })}
>
<Text>{item.done ? '☑️' : '☐'} {item.text}</Text>
<TouchableOpacity onPress={() => deleteTodo(item.id)}>
<Text>🗑️</Text>
</TouchableOpacity>
</TouchableOpacity>
)}
/>When the todo list is empty, an empty state message shows up, and pressing a todo item navigates to the Detail screen.5-Minute Try-It
Keep building out the Todo App with ListEmptyComponent + navigation (the Detail screen) until it's complete — this is the capstone project for the whole tutorial.
A Quick Word of Caution
With nested TouchableOpacity (item press + delete button press), React Native's event bubbling behavior can differ slightly by platform (iOS/Android) — be sure to test on both.
Real-world usage
How to apply it in a real project
Test an original Mini Project Part 3: Todo App — Polish & Navigation 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 3: Todo App — Polish & Navigation 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
<FlatList
data={todos}
keyExtractor={(item) => item.id}
ListEmptyComponent={
<Text style={styles.emptyText}>No todos yet! Add one above 👆</Text>
}
renderItem={({ item }) => (
<TouchableOpacity
style={styles.todoItem}
onPress={() => navigation.navigate('TodoDetail', { todoId: item.id })}
>
<Text>{item.done ? '☑️' : '☐'} {item.text}</Text>
<TouchableOpacity onPress={() => deleteTodo(item.id)}>
<Text>🗑️</Text>
</TouchableOpacity>
</TouchableOpacity>
)}
/>Expected: Explain the React and native-platform behavior of Mini Project Part 3: Todo App — Polish & Navigation
Show hint
Test an original Mini Project Part 3: Todo App — Polish & Navigation 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 3: Todo App — Polish & Navigation 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.
- Nesting the delete button inside the outer TouchableOpacity (the item press), so tapping the delete icon also triggers the item's detail navigation right away (an event propagation issue — you may need stopPropagation logic)
- Test an original Mini Project Part 3: Todo App — Polish & Navigation 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