Skip to content

Instantly share code, notes, and snippets.

@onosendi
Created March 6, 2022 17:10
Show Gist options
  • Save onosendi/4b62fe69cb2e821125de601b50fd3ef7 to your computer and use it in GitHub Desktop.
Save onosendi/4b62fe69cb2e821125de601b50fd3ef7 to your computer and use it in GitHub Desktop.
function OrderForm() {
const { cart, reset } = useCartContext();
const onSubmit = async () => {
try {
await api('foo.com', cart);
reset();
} catch (error) {
console.error(error);
}
};
return (
...
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment