O'Reilly logo

React Native By Example by Richard Kho

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Updating the TasksList component

Next, let's make changes to TasksList so that it supports EditTask. It should do the following:

  1. Import the EditTaskContainer for us to push to the navigator.
  2. Add the Platform API to support Android devices.
  3. Modify the onLongPress callback for TasksListCell to call a function that first adds the currently selected task to the Redux state and then navigate the user to the EditTaskContainer. It should contain a Cancel and Save button.
  4. The Cancel button should fire a function that pops the navigator and resets the selectedTaskObject value in your Redux state.
  5. The Save button should fire a function that pops the navigator and saves the selectedTaskObject into the listOfTasks array in your Redux state.

 

Here ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required