I have a simple react form with an onSubmit handler. Inside the handler a post request is made. It's like this
const handleSubmit = async (e) => {
e.preventDefault();
const response = await fetch('...', method post, body ... etc)
setStatus(await response.text())
}
The problem I'm having is that my function is basically still triggered by the enter button so it makes a post request. I want this to only happen when someone actually clicks the button. I thought maybe I could do this by filtering on the event keyCode but I can't find it.