React has its own "synthetic events" which wrap the underlying native DOM events. The core of your problem is the confusion between the synthetic event and the native event. Your handleFavorites method is currently expecting a native event, while the button onClick provides a synthetic event. With your current types, you could actually do this onClick={e => handleFavorites(e.nativeEvent)}, though I don't recommend it.
Everyone else is correct that you want to pass your callback as onClick={handleFavorites}. But in order to do that, your handleFavorites needs to accept a synthetic event. React and the DOM both have their own interfaces for a MouseEvent with the same name, so you need to make sure that you are using the right one.
- You can change the type to
(event: React.MouseEvent) which makes it clear that this is react synthetic event.
- You can keep
(event: MouseEvent) and import the react version into your file import React, {MouseEvent} from "react";
Note that the native event and the synthetic event both have a preventDefault() method, so switching the type won't necessitate changes in the function.
onClick={e => handleFavorites(e)}?MouseEvent<HTMLButtonElement>.