I don’t understand why when I click on the <ControlsButton /> which has the “onClick” event, the function countSecond doesn’t run. Is there something that I’m missing?
I just tried creating a test <button></button> element with onClick={countSecond} in it, and that worked fine. So there must be something wrong with my <ControlsButton /> component?
I’ve solved the problem just now. Turns out the way i did it was incorrect. For it to work I needed to put the onClick={props.onClick} inside the <ControlsButton /> component and this seems to solve the issue