Trying to display results after applying filter function.I need to compare with searchValue.but it gives Error
{noteList.filter((obj,index) => <Card
noteObj={obj.Name.toLowerCase().includes(searchValue)}
index={index}
deleteNote={deleteNote}
updateNoteArray={updateNoteArray}
/>)
}
>Solution :
use map not filter
{ noteList
.filter((obj, index)=>{ return obj.Name.toLowerCase().includes(searchValue)})
.map((obj,index) => <Card
noteObj={obj.Name.toLowerCase().includes(searchValue)}
index={index}
deleteNote={deleteNote}
updateNoteArray={updateNoteArray}
/>)
}