When writing functions that can handle various different types of dom events in react, it's important to remember that react uses its own custom type of events which it calls "synthetic events". To best handle these, we create a custom type which can be either a native event or a react synthetic event.
Example code
import type { SyntheticEvent } from 'react';
type ReactCompatibleEvent = Event | SyntheticEvent;