@MikeBish13
Posted
Great job on the project - looks really good!
In answer to your question - the issue that you have is that you are using jobList for everything and so this keeps getting overwritten with new pieces of filtered data and so you can never return to the initial list of jobs. What you need is a separate array/piece of state for your filtered results. This is how your app currently works:
- jobList is populated with data and this loads on the page. All good so far.
- 'Frontend' filter is clicked and jobList is filtered accordingly. So your filter is working up to this point.
- 'Frontend' filter is unclicked and so your filter removes everything in jobList, which leaves you with an empty array.
- Now when you try to display all of your items again using jobList, you're doing so from an empty array and so nothing is displayed.
Hope that helps!
Marked as helpful