Thuta Learning
React Native
ProjectsMobile DevelopmentIntermediate

Mini Project Part 3: Todo App — Polish & Navigation

React NativeLesson 3030 min

What you'll walk away with

  • Explain the React and native-platform behavior of Mini Project Part 3: Todo App — Polish & Navigation
  • Test accessibility, failure, and lifecycle cases
  • Write maintainable, testable, and performant React Native

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.

Mental model
  1. project requirements
  2. components, state, and services
  3. tested UI

Explain the React and native-platform behavior of Mini Project Part 3: Todo App — Polish & Navigation

Core syntax or pattern

javascript
<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

  1. project requirements<FlatList

    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.

  2. components, state, and servicesonPress={() => 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.

  3. 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.

Execution flow
  1. project requirements
  2. components, state, and services
  3. 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

javascript
<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>
  )}
/>
You should see
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
javascript
<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

What best describes the core idea of Mini Project Part 3: Todo App — Polish & Navigation?

Quick quiz 2 / 3

Which mistake should you avoid first?

Quick quiz 3 / 3

How should this be applied in a real project?

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

Easy traps

  • 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)
  • Leaving the empty state unimplemented so users just see a blank screen — this can be confusing
  • Assuming one simulator's happy path proves every real-device, release-build, permission, accessibility, offline, and lifecycle path.

Hands-on Exercise

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.

You'll know it worked when: When the todo list is empty, an empty state message shows up, and pressing a todo item navigates to the Detail screen.

Updated on

Progress is saved only in this browser on this device. It isn't synced to other devices.

Report a problem with this lessonOpens your email app with this lesson's address filled in — nothing is sent until you send it.

Mini Project Part 3: Todo App — Polish & Navigation | Thuta Learning