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 TasksListContainer to accommodate EditTask

Now we should update the TasksListContainer and TasksList component. First, TasksListContainer should do the following:

  • Import the changeCurrentlyEditedTask, resetSelectedTask, and saveSelectedTaskDetails actions and add them to the mapDispatchToProps method
  • Import the date, formattedDate, and selectedTaskObject properties of our Redux state and add them to the mapStateToProps method

Take a look at the following code:

// TasksRedux/app/containers/TasksListContainer 

... 
import { 
  ... 
  changeCurrentlyEditedTask, 
  resetSelectedTask, 
  saveSelectedTaskDetails 
} from '../../actions'; 

Above, I imported three new actions.

 ... const mapDispatchToProps = (dispatch) => { return { ... changeCompletionStatus: ...

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