The error message in full:
This expression is not callable.
No constituent of type 'true | CallableFunction' is callable
Here is the portion of code causing the error:
public static base(
text,
callB: boolean | CallableFunction = false,
) {
const sw = Swal.fire({
text,
});
if (callB) {
sw.then(callB());
}
}
To address the issue, I updated the type of callB to :
callB: (param: any) => void |boolean = false
However, upon removing the callB type definition:
callB= false
A new error emerged:
This expression is not callable.
Type 'Boolean' has no call signatures