You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hence, the currentTarget is always a Node. Wouldn't it make sense to add another generic argument so that we can specify the exact type of the currentTarget (for example a Rect or any other)?
So this includes a first argument which is this and it doesn't actually enforece the type of currentTarget.
What I would need would be (with the previous modification of the KonvaEventObject type) would be:
right now I can't specify the type of the currentTarget, and have to resort to check the type in each listener
when declaring an event listener function, I'd like a generic type to describe it instead of always having to write the same (event: KonvaEventObject) => void thing.
Maybe I'm missing something though, thoughts and comments welcome 🙏
The text was updated successfully, but these errors were encountered:
I'm using Konva with React. I'm noticing the type of
KonvaEventObject
is:Hence, the
currentTarget
is always aNode
. Wouldn't it make sense to add another generic argument so that we can specify the exact type of thecurrentTarget
(for example aRect
or any other)?Something like:
I was hoping that the type
KonvaEventListener
would provide me with a way to do that, but the current type is:So this includes a first argument which is
this
and it doesn't actually enforece the type ofcurrentTarget
.What I would need would be (with the previous modification of the
KonvaEventObject
type) would be:The reason for that is that:
(event: KonvaEventObject) => void
thing.Maybe I'm missing something though, thoughts and comments welcome 🙏
The text was updated successfully, but these errors were encountered: