The previous month's expenses

The next step that we want to carry out is to create a view that shows us the expenses for each month and then allows the user to enter that view by tapping on one of these months. This view should be navigated to when the user long presses on a month in the PreviousMonthsList component.

Thankfully, we already have a component that can handle this for us. In the last chapter, we built the CurrentMonthExpenses component that renders the expenses for a given month.

So far in our app, CurrentMonthExpenses is being rendered in just one place--App.js. The container that it renders within has a top margin offset to accommodate the navigation bar.

If we want to reuse the CurrentMonthExpenses component to render any ...

Get React Native By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.