Skip to content

Instantly share code, notes, and snippets.

@lucas-lm
Created March 7, 2020 01:19
Show Gist options
  • Select an option

  • Save lucas-lm/b26d1799bf5220b68e884a8646393aa7 to your computer and use it in GitHub Desktop.

Select an option

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

lucas-lm commented Mar 7, 2020

Copy link
Copy Markdown
Author

My useCanvas hook is required.

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