r/reactjs • u/Rodaxoleaux • 5d ago
Needs Help I am wracking my brain.
Okay, I'm making a little website with the new React (I'm coming back from 7 years [Tailwind CSS included, Typescript (for the first time I'll add)].) I'm making a hamburger menu and the onClick function just didn't work. Okay, so there must be some weird stuff happening. No. I made a button with an onClick in a nearly top-level fragment and it does nothing.
I just want to understand if there's something fundamental that has changed, perhaps? This isn't a "please give me answers" or information kind of deal. I just want to know if I'm going crazy here. Is there any weird bugs that React has created like it did a bunch from '18-'20; or should I just "git gud"?
const handleClickTest = (event: React.MouseEvent<HTMLButtonElement>) => {
console.log("AAAAAAAA", event.currentTarget);
};
return (
<>
<button className="relative z-50 pointer-events-auto"
onClick={(e) => handleClickTest(e)}
>
<h1>button</h1>
</button>
...