# Property does not exist on type 'never'

**URL:** <https://forum.codewithmosh.com/t/property-does-not-exist-on-type-never/22841>\
**Category:** React\
**Created:** [October 4, 2023, 7:36pm UTC](https://forum.codewithmosh.com/t/property-does-not-exist-on-type-never/22841 "2023-10-04T19:36:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ameneses67](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/ameneses67/32/7065_2.png) [@ameneses67](https://forum.codewithmosh.com/u/ameneses67)\
**Post date:** [October 4, 2023, 7:36pm UTC](https://forum.codewithmosh.com/t/property-does-not-exist-on-type-never/22841/1 "2023-10-04T19:36:16Z")

</div>

**React 18 for beginners’ course - Expense tracker project.**  
In the video where Mosh shows how to complete the project, he creates an useState hook and he initializes it with some sample data to evaluate further functionalities.

`const [expenses, setExpenses] = useState([]);`

This useState should initialize with an empty array, without any sample data. This array will be populated when you submit each expense through the expense form.

When I delete the sample data, I get the following error message when trying to render objects of that empty array.

_Property ‘category’ does not exist on type ‘never’_

How can I get rid of this typescript error? The application still works but I have this error on my code.

Thanks,

---

<div class="post-metadata">

**Author:** ![ChrisUribe](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/chrisuribe/32/62_2.png) [@ChrisUribe](https://forum.codewithmosh.com/u/ChrisUribe)\
**Post date:** [October 10, 2023, 6:23pm UTC](https://forum.codewithmosh.com/t/property-does-not-exist-on-type-never/22841/2 "2023-10-10T18:23:35Z")

</div>

You’ll need to post more of your code. There is a place somewhere in your code that you are accessing `variableNameIDontKnowWhat.category`. That’s what the error is saying. Can you post a small section of your code that is accessing the property ‘category’?

---

<div class="post-metadata">

**Author:** ![ameneses67](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/ameneses67/32/7065_2.png) [@ameneses67](https://forum.codewithmosh.com/u/ameneses67)\
**Post date:** [October 11, 2023, 3:49am UTC](https://forum.codewithmosh.com/t/property-does-not-exist-on-type-never/22841/3 "2023-10-11T03:49:35Z")

</div>

I was able to fix it. Thanks anyway for your support.
