Here's some TSX
const App = {
processData(data: string) {},
forwardEvent(this: { processData(data: string): void }, data: Event) {
this.processData(event?.type || "");
}
}
render(<input
type="text"
onChange={App.forwardEvent} // NOOOOOO!!!!
/>, document.body);
Expected behavior: compile error due to incompatible this types.
Actual behavior: compiles fine with the undeclared this parameter in jsx.d.ts, runtime error as soon as the event fires 😢 .
In Preact version 10.0.5.
Here's some TSX
Expected behavior: compile error due to incompatible
thistypes.Actual behavior: compiles fine with the undeclared
thisparameter injsx.d.ts, runtime error as soon as the event fires 😢 .In Preact version 10.0.5.