Created
March 7, 2020 01:19
-
-
Save lucas-lm/b26d1799bf5220b68e884a8646393aa7 to your computer and use it in GitHub Desktop.
Canvas component
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
import React from 'react' | |
import useCanvas from '../hooks/useCanvas' | |
const Canvas = props => { | |
const { draw, ...rest } = props | |
const canvasRef = useCanvas(draw) | |
return ( | |
<canvas ref={canvasRef} {...rest} /> | |
) | |
} | |
export default Canvas |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
My useCanvas hook is required.