input!.addEventListener('keyup', (event) => {
console.log(event.target.value);
});
TS compiler claims that event might be null. How could this be? By definition, this is a callback function that will be invoked whenever there is a keyup event.
I understand that this can be easily resolved with: (event.target as HTMLSelectElement).value. I'm not asking about a solution for this. I am curious as to what TS is.
Why/how can event be null inside a callback function for that event?