Created
February 27, 2021 03:07
-
-
Save JaysonChiang/f00b096f202cfb5c93e084b04bb5a5b2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const EventComponent: React.FC = () => { | |
const onChange = (event: React.ChangeEvent<HTMLInputElement>) => { | |
console.log(event.target.value); | |
}; | |
const onDragStart = (event: React.DragEvent<HTMLDivElement>) => { | |
console.log(event); | |
}; | |
return ( | |
<div> | |
<input onChange={onChange} /> | |
<div draggable onDragStart={onDragStart}>Drag me</div> | |
</div> | |
); | |
}; | |
export default EventComponent; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment