I'm encountering an issue when trying to pass the doSomething
function into performAction
. The error message I'm receiving is Expected 0 arguments, but got 1
interface SomeInterface {
name: string,
id: string
}
function doSomethingFunction(props: SomeInterface) {
console.log(props.name + " " + props.id);
}
function performAction(doSomething: () => void) {
doSomething({
name: "foo",
id: "bar"
});
}
performAction(doSomethingFunction);
Is my syntax correct for Typescript?