Sanity Check failed- Form validation

So I’m making a website for my dad and I’m adding form validation and when I submit the for my event listener gets called. Here is the code:

const handleFormSubmit = (e) => {
    console.log(formSubmit);
    e.preventDefault();
    return false;
};

Losing sanity, help would be appreciated.

the log gets outputted, but the submission is not cancelled.

Post the full code for the component. You have a GitHub repo ?

lemme write up a quick codepen

here is a demo that works surprisingly
https://codepen.io/ijusterikk/pen/poEawNd

what exactly do you want to happen?

here is a demo that works surprisingly

if its working correctly then what is the problem? it is hard to advise if we dont see the code your talking about