Answers for "react native sectionlist filter"

0

react native sectionlist filter

searchFilterFunction(text) {

  if( text == undefined || text == '') {
    this.setState({
      sectiondata: this.arrayholder
    })
    return;
  }

  if (text.trim().length > 0) {
      var temp = []
      this.state.sectiondata.map((item) => {
            var dataItem = {};

            var title = item.title;
            var brandData = [];

            item.data.map((searchItem) => {
              let flatName =  searchItem.flat_name
                if (flatName.match(text)) {
                  brandData.push(searchItem);
                }
            })
            if (brandData.length > 0) {

            } else {
              return null;
            }
            dataItem.title = title;
            dataItem.data = brandData;
            temp.push(dataItem);
            this.setState({
              sectiondata: temp
            })
      })
Posted by: Guest on March-01-2021

Code answers related to "react native sectionlist filter"

Code answers related to "Javascript"

Browse Popular Code Answers by Language