After spending countless hours trying to solve my filtering issue, I'm still struggling. I'm in the middle of creating a react marketplace where users need to be able to apply multiple filters on one page. Here's an example of my product list:
productsList = [{brand: 'Zara', category: 'Jeans', color: 'blue'}, {brand: 'BlaBla',color: 'blue', category: 'Leggins'}, {brand: 'Louis', category: 'Leggins', color: 'red'}, {brand: 'Louis', category: 'Jeans', color: 'pink'}]
In my state, I have an object containing various filter options:
filters: {
designers: ['Zara', 'Louis'],
categories: [],
colors: ['pink']
}
If I only want to display Zara jeans that are blue, how can I effectively filter out the results? I've tried using lodash and other methods found online but haven't been successful yet. Any guidance would be greatly appreciated!