Skip to content

Instantly share code, notes, and snippets.

@andrevandal
Created September 14, 2022 21:42
Show Gist options
  • Save andrevandal/d83c67afe5f5b21cd691a42cc7af86b4 to your computer and use it in GitHub Desktop.
Save andrevandal/d83c67afe5f5b21cd691a42cc7af86b4 to your computer and use it in GitHub Desktop.
const pagina = ''
const handleBusca = (e) => {
const params = Object
.entries({ pagina, busca: e.target.value })
.filter(([key, value]) => !!value)
return setSearchParams(Object.fromEntries(params))
}
console.log({ target: { value: 'olá, mundo!' } })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment