"No overload matches this call" for removeEventListener and addEventListener "No overload matches this call" for removeEventListener and addEventListener reactjs reactjs

"No overload matches this call" for removeEventListener and addEventListener


The issue appears to be answered this question:react typescript issue on addEvenListener

The handler function for addEventListener and removeEventListener does not accept a React.KeyboardEvent as a parameter. It needs a DOM event.