-
-
Save neurobug/2b83c970d406af534a7b012db2bf404b 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