In this code
document.addEventListener('keydown', (e: SyntheticKeyboardEvent<Document>) => {
if (e.ctrlKey && e.shiftKey && e.code === 'KeyE' && !this.state.envChangePopupOpened) {
this.openPopup();
}
});
Flow gives 2 issues which seem to not be as such.
First it gives this cryptic message:
Cannot call `document.addEventListener` because: Either string [1] is incompatible with enum [2]. Or string [1] is incompatible with enum [3]. Or `KeyboardEvent` [4] is incompatible with `SyntheticKeyboardEvent` [5] in the first argument. Or string [1] is incompatible with enum [6]. Or string [1] is incompatible with string literal `wheel` [7]. Or string [1] is incompatible with enum [8]. Or string [1] is incompatible with enum [9]. Or string [1] is incompatible with enum [10]. Or string [1] is incompatible with enum [11]. Or string [1] is incompatible with enum [12]. Or `Event` [13] is incompatible with `SyntheticKeyboardEvent` [5] in the first argument. (References: [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13])
and second gives:
property `code` is missing in `SyntheticKeyboardEvent` [1]. (References: [1])
But it should be on e.
How do you handle these?
EDIT:
The second issue turns out is not supported in SyntheticEvent and should be worked around.