Created
March 6, 2022 17:10
-
-
Save onosendi/4b62fe69cb2e821125de601b50fd3ef7 to your computer and use it in GitHub Desktop.
This file contains 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
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