{nDATA
.filter((newData) => newData.titles.includes(props.currentFilter))
.map((value, index) => (
So in the code above I have nDATA which is an array of objects that I am filtering and mapping out.
Then I also have props.currentFilter which is a prop being passed into this component that is an array list for example
["Apples", "Oranges", "Strawberries", "Grapes"]
What I am trying to do here is get my filter setup here to check each newData.titles for each of the arrays in props.currentFilter. That way when I am searching for say Apples and Oranges and Grapes, it will check each thing for each of those and if it has 1 of them it goes through. My setup right now is working perfect if I pass just a string into the includes by doing props.currentFilter[0] but that does me no good for what I am trying to do here. I have been trying to test a few ways to do this and have been struggling to figure this out, any help would be much appreciated =D
newData.titlesa string?.filter(newData => props.currentFilter.some(str => newData.titles.includes(str)))