score:3

Accepted answer

use axios api to call api and fetch data

onkeyup(e) {
  axios.get('/seachdata?keywords='+e.target.value)
  .then(function (response) {
     this.setstate({autosearchresponse: response.data})
  })
  .catch(function (error) {
    console.log(error);
  });
}

search data set in this.state.autosearchresponse you can use autosearch response as html

 {this.state.autosearchresponse.map((value, i)=>
  <div key={i}>{value}</div>    
)}

bind onkeyup function to input


Related Query

More Query from same tag