title: highlight searching text on type react
body: <p>I try to highlight text in a input on typing, I use two method in this case. As I understand I need return on search something like this: <code>&lt;mark&gt;${item}&lt;mark/&gt;</code> </p>
  
  <pre><code>fuzzyContains = (text, search) =&gt; {
          debugger
          if (!text)
              return false
          if (!search)
              return true
  
          search = search.toLowerCase()
          text = text.toString().toLowerCase()
  
          let previousLetterPosition = -1
  
          return search.split('').every(s =&gt; {
              debugger
              previousLetterPosition = text.indexOf(s, previousLetterPosition + 1)
  
              return previousLetterPosition !== -1
          })
      }
  
      handleSearch = search =&gt; {
          const {data} = this.state
          debugger
          let filteredData = data.filter(x =&gt; Object.keys(x).some(key =&gt; {
              debugger
              this.fuzzyContains(x[`&lt;mark&gt;${key}&lt;mark/&gt;`], search)}))
  
          this.setState({filteredData, search})
      }
  </code></pre>