score:13

It's been a while but I've faced such issues always when I had nested components with the same type of eventListener attached. For example an outer component with an onClick prop and an inner element with another onClick prop.

if the inner one gets clicked the event bubbles up to the outer and the onClick callback of the outer element gets called too. Within the stack trace you see now that it was invoked by the invokeGuardedCallback

to stop the event from bubbling up, call

event.stopPropagation();

within the callback function of the inner element.

There might be other scenarios where the ivokeGuardedCallback could invoke a callback - to make sure you could always go read the code.


Related Query

More Query from same tag