Last active
March 26, 2020 18:39
-
-
Save richarddprasad/cbe572223e46d6cb7e8110ffdcc3ee27 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
React.useEffect(() => { | |
let mouseDown: boolean = false; | |
... | |
return function cleanup() { | |
if (canvasRef.current) { | |
canvasRef.current.removeEventListener('mousedown', handleMouseDown); | |
canvasRef.current.removeEventListener('mouseup', handleMouseUp); | |
canvasRef.current.removeEventListener('mousemove', handleMouseMove); | |
} | |
} | |
}, [context]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment