If I run the example below in React, this = undefined
and event.currentTarget = null
.
How do I get the element the event was bound to?
<div onMouseEnter={(event) => console.log(event.target)}>
<span>HELLO</span>
</div>
If I run the example below in React, this = undefined
and event.currentTarget = null
.
How do I get the element the event was bound to?
<div onMouseEnter={(event) => console.log(event.target)}>
<span>HELLO</span>
</div>