I'm currently facing an issue with passing a function that returns either true or false as a prop. The function in question looks like this:
canBeUsed(): boolean {
if (this.usable) {
return true
}
return false
}
The component receiving the props has the following code snippet:
props: {
canBeUsed: {
type: Boolean
}
}
Unfortunately, I keep getting a warning stating
Invalid prop: type check failed for prop "canBeUsed". Expected Boolean, got Function
This error occurs because I am passing a function that ultimately resolves to a boolean value. Despite this, the functionality works fine. However, I would like to address this warning. Any assistance on resolving this is highly appreciated. Thank you!