# Expense filter: why is "All categories" showing all?

**URL:** <https://forum.codewithmosh.com/t/expense-filter-why-is-all-categories-showing-all/20817>\
**Category:** React\
**Created:** [June 14, 2023, 11:58pm UTC](https://forum.codewithmosh.com/t/expense-filter-why-is-all-categories-showing-all/20817 "2023-06-14T23:58:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![deadlifter](https://avatars.discourse-cdn.com/v4/letter/d/45deac/32.png) [@deadlifter](https://forum.codewithmosh.com/u/deadlifter)\
**Post date:** [June 14, 2023, 11:58pm UTC](https://forum.codewithmosh.com/t/expense-filter-why-is-all-categories-showing-all/20817/1 "2023-06-14T23:58:30Z")

</div>

Hi!

I am currently taking the react course. I was watching video 12 in the “Building Forms” Chapter and I realized when we made the expense filter that for some reason, the hard coded “All categories” option still shows all categories, despite going through the filter:

const visibleExpenses = selectedCategory  
? expenses.filter((e) =\> e.category === selectedCategory)  
: expenses;

Can anyone explain? Thank you!
