I get this error message when I try to call onclick with conditional rendering. I have one functional component for a Task and based on the status, one of the functions should fire. enter image description here
CodePudding user response:
You need to invoke the function, isPending()
instead of isPending
on your div.
CodePudding user response:
You should assign a default function definition to onCheckedClicked if it is not provided in the props
const { onCheckedClicked = ()=>null } = props;