Skip to content

Instantly share code, notes, and snippets.

@amanda-mitchell
Created February 10, 2019 22:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amanda-mitchell/f4abe8775fb496e9cd4b3bfe02ea7d7b to your computer and use it in GitHub Desktop.
Save amanda-mitchell/f4abe8775fb496e9cd4b3bfe02ea7d7b to your computer and use it in GitHub Desktop.
function CanvasComponent() {
const canvasRef = useRef<HTMLCanvasElement | null>(null);
useEffect(() => addTouchListener(canvasRef.current), [canvasRef.current]);
return <canvas ref={canvasRef} />;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment