Functional component with render function:
render(createElement, { listeners } {
return createElement('div', {
on: {
click: () => {
// issue is on this line
const onItemClick: any = listeners['item-click']
onItemClick(1, 2, 3)
}
}
})
}
How to correctly type onItemClick so i won't get an error:
const onItemClick: Function | Function[]
This expression is not callable.
No constituent of type 'Function | Function[]' is callable.ts(2349)
Signature of listeners:
var listeners: {
[key: string]: Function | Function[];
}