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 TasksListContainer

Next, we need to update the TasksListContainer so that it does the following:

  • Maps the getListOfTasksAndIndex action and currentIndex value to its props
  • Modifies the addTask action to expect and send an index argument

These are the changes I ended up with:

 // TasksRedux/containers/TasksListContainer/index.js ... import { ... getListOfTasksAndIndex, } from '../../actions'; import TasksList from '../../components/TasksList'; const mapDispatchToProps = (dispatch) => { return { addTask: (text, index) => { dispatch(addTask(text, index)); }, ... getListOfTasksAndIndex: () => { dispatch(getListOfTasksAndIndex()); }, ... } } const mapStateToProps = (state, { navigator }) => { return { currentIndex: state.currentIndex, ...

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