Skip to content
Advertisement

How to fix a this react filter?

I have created a database in firebase and I have fetch it in react, that is working correctly, but I want to include a search bar to filter the elements, my problem is that when I search for an element everything works but when I delete the text from the search input the elements do not appear again.

JavaScript

Advertisement

Answer

You can set another state array that keeps track of all the products.

ex:

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement