react native sectionlist filter

Solutions on MaxInterview for react native sectionlist filter by the best coders in the world

showing results for - "react native sectionlist filter"
Julian
13 Jun 2020
1searchFilterFunction(text) {
2
3  if( text == undefined || text == '') {
4    this.setState({
5      sectiondata: this.arrayholder
6    })
7    return;
8  }
9
10  if (text.trim().length > 0) {
11      var temp = []
12      this.state.sectiondata.map((item) => {
13            var dataItem = {};
14
15            var title = item.title;
16            var brandData = [];
17
18            item.data.map((searchItem) => {
19              let flatName =  searchItem.flat_name
20                if (flatName.match(text)) {
21                  brandData.push(searchItem);
22                }
23            })
24            if (brandData.length > 0) {
25
26            } else {
27              return null;
28            }
29            dataItem.title = title;
30            dataItem.data = brandData;
31            temp.push(dataItem);
32            this.setState({
33              sectiondata: temp
34            })
35      })
36
similar questions
queries leading to this page
react native sectionlist filter