Consider the following interface:
interface MyProps {
onEvent: (name: string, data: any) => void;
}
Is there a way to utilize the function type in order to avoid unused parameter errors during compilation?
eventHandler = (name: string, data: any) => {
console.log(data);
}
I am encountering a complication where I am receiving a compilation error for an unused parameter "name". Removing it would disrupt the underlying type's signature, so is there a workaround for this issue?
I attempted the following approach, but unfortunately it did not work as expected:
eventHandler: MyProps.onEvent = (name, data) => {
console.log(data);
}