Skip to content

Instantly share code, notes, and snippets.

@neurobug
Forked from lucas-lm/Canvas.js
Created April 15, 2021 16:55
Show Gist options
  • Save neurobug/24ecee18277f3de7c82c8bf83e2f8e92 to your computer and use it in GitHub Desktop.
Save neurobug/24ecee18277f3de7c82c8bf83e2f8e92 to your computer and use it in GitHub Desktop.
Canvas component
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