0

I've written onMouseOver event for a shape/node - '' in React-Konva. Here I'm able to access e.target . But I'm getting 'undefined' for e.relatedTarget . Can anyone please explain how to get that value? Thanks. Below is my code....

<Stage width={window.innerWidth} height={window.innerHeight}>
    <Layer>
        <Rect x={50} y={50} onMouseOver={onMouseOverRect}/>
    </Layer>
</Stage>

const onMouseOverRect = (e) => {
const trgt = e.target;
const relTrgt = e.relatedTarget;
console.log(trgt, "target");
console.log(relTrgt, "related Target");  
};

I tried OnMouseEnter also. Same result. I tried googling it. But I couldn't find anywhere it is used in React Konva Canvas.

Sunny
  • 708
  • 1
  • 4
  • 21
g1mahadik
  • 1
  • 1

1 Answers1

0

There is no relatedTarget in Konva events. There is:

  1. e.target - initial target of event, usually shape
  2. e.currentTarget - the node where you attach a listener
lavrton
  • 18,973
  • 4
  • 30
  • 63