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

Deleting expenses

For users to delete expenses from any month, we need to do the following things:

  • Add a method to storageMethods to update an expenses object. It should accept the month, year, and array of expenses. Then, it should override the array of expenses for that specific month and year combination in AsyncStorage with this new array, and recalculate the amount spent.
  • Wrap a TouchabbleHighlight component around each row that, when long pressed, opens an alert that asks the user whether they wish to delete the item.
  • If the user confirms that they would like to delete the item, then we should delete it. A new array of expenses for the current month should be created without the deleted item, and it should be saved using the storageMethods ...

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