Skip to content

Instantly share code, notes, and snippets.

@lucas-lm
Created March 7, 2020 01:19
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save lucas-lm/b26d1799bf5220b68e884a8646393aa7 to your computer and use it in GitHub Desktop.
Save lucas-lm/b26d1799bf5220b68e884a8646393aa7 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
@lucas-lm
Copy link
Author

lucas-lm commented Mar 7, 2020

My useCanvas hook is required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment