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

Selecting a category

We will modify our existing AddExpensesModal component to add the following functionality:

  • Create a Button right below the ExpandableCell/DatePickerIOS component to select a category for our expense.
  • On press, that button should render a Picker component for the user to interact with. This Picker should have the following features:
    • Contain the list of twelve categories that we are using in our app as Picker items by mapping the array instead of hardcoding each of the twelve categories.
    • Have a callback that sets the selected value as the selected category for our expense. Next:
      • Render this Picker as a child of an ExpandableCell component within AddExpensesModal so that it can be collapsed when not in use.
      • Render the ...

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