Skip to content

Instantly share code, notes, and snippets.

@surajitbasak109
Created February 10, 2020 20:02
Show Gist options
  • Save surajitbasak109/1e7c5f03af18ec8f309a0e291bd69c26 to your computer and use it in GitHub Desktop.
Save surajitbasak109/1e7c5f03af18ec8f309a0e291bd69c26 to your computer and use it in GitHub Desktop.
constructor(props){
// ... more code ...
}
autocomplete(evt) {
let text = evt.target.value;
fetch(`http://localhost:3004/items?name_like=${text}&_limit=6`)
.then(res => res.json())
.then(data => {
this.setState({ searchItems: data });
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment