Here, I want to filter Flatlist data as per top categories and button should be multi-selected.
FlatList data is HotelData array and above categories is also one array that is used inside scrollview using map function.
so by selecting multiple categories i want to filter Flatlist data, so if anyone has done this task, please help me for the same.
const HotelData = [{ id: '1', img: require('../Assets/UIPracticeImage/H1.jpg'), name: 'Chef Vincent', desc: 'Lorem ipsum dolor sit amet aliquon sciscilant', tag: 'Toutes possibilities', compareKey: 1,},{ id: '2', img: require('../Assets/UIPracticeImage/H2.jpg'), name: 'Pine hill green caben', desc: 'Lorem ipsum dolor sit amet aliquon sciscilant', tag: 'Restaurants', compareKey: 2,},{ id: '3', img: require('../Assets/UIPracticeImage/H3.jpg'), name: 'Sky Palace', desc: 'Lorem ipsum dolor sit amet aliquon sciscilant', tag: 'Restaurants', compareKey: 2,},{ id: '4', img: require('../Assets/UIPracticeImage/H4.jpg'), name: 'Green leaf', desc: 'Lorem ipsum dolor sit amet aliquon sciscilant', tag: 'Toutes possibilities', compareKey: 1,},{ id: '5', img: require('../Assets/UIPracticeImage/H1.jpg'), name: 'Pine green leaf', desc: 'Lorem ipsum dolor sit amet aliquon sciscilant', tag: 'Bars', compareKey: 3, },];const [categories, setCategories] = useState([ {name: 'Toutes possibilités', key: 1, isCheck: false, compareKey: 1}, {name: 'Restaurantes', key: 2, isCheck: false, compareKey: 2}, {name: 'Bars', key: 3, isCheck: false, compareKey: 3},]);