Skip to content

Instantly share code, notes, and snippets.

@ashikka
Created December 31, 2021 13:24
Show Gist options
  • Select an option

  • Save ashikka/5ed2ceb0e7b1a7daaf2122faa96c9481 to your computer and use it in GitHub Desktop.

Select an option

Save ashikka/5ed2ceb0e7b1a7daaf2122faa96c9481 to your computer and use it in GitHub Desktop.
const [searchResults, setSearchResults] = useState([]);
const [searchTerm, setSearchTerm] = useState[""];
const handleChange = event => {
setSearchTerm(event.target.value);
}
async function getResults(searchTerm){
setSearchResults(await getPhotos(searchTerm));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment