function square(number: number, event: Event) {
const squaredNumber = number * number;
console.log(`${number} squared is ${squaredNumber}`);
}
// no type error here, which I would expect since I'm passing a string as an argument that should be a number:
const Example = () => (
<button onClick={[square, "not a number"]}>click here</button>
);
function square(number: number, event: Event) {
const squaredNumber = number * number;
console.log(`${number} squared is ${squaredNumber}`);
}
// no type error here, which I would expect since I'm passing a string as an argument that should be a number:
const Example = () => (
<button onClick={[square, "not a number"]}>click here</button>
);