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,