Reputation: 1
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.
Upvotes: 0
Views: 90
Reputation: 20373
There is no relatedTarget
in Konva events. There is:
e.target
- initial target of event, usually shapee.currentTarget
- the node where you attach a listenerUpvotes: 0