Skip to content

Instantly share code, notes, and snippets.

@JaysonChiang
Created February 27, 2021 03:07
Show Gist options
  • Save JaysonChiang/f00b096f202cfb5c93e084b04bb5a5b2 to your computer and use it in GitHub Desktop.
Save JaysonChiang/f00b096f202cfb5c93e084b04bb5a5b2 to your computer and use it in GitHub Desktop.
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