I've created a simple Budget app using React. The user can add Income/Expense Description and Value by filling out the inputs and the final result gets added to the Expenses/Incomes lists.
I managed to add the Income/Expenses values (numbers): I've created a setState with incomes: [1, 3, 4], map around the income array and print out the values by updating the state.
I can't understand how to add the description. I've checked some questions here on Stack but they only use setState and creating a state for each element (incomes, incomeValues, expenses, expensesValue), which is not what I want.
Is there a way to do this without involving too many states? Maybe using an Object?