Created
February 10, 2020 20:02
-
-
Save surajitbasak109/1e7c5f03af18ec8f309a0e291bd69c26 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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