diff options
Diffstat (limited to 'src/components/GameCanvas.tsx')
-rw-r--r-- | src/components/GameCanvas.tsx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/components/GameCanvas.tsx b/src/components/GameCanvas.tsx new file mode 100644 index 0000000..ea93c64 --- /dev/null +++ b/src/components/GameCanvas.tsx @@ -0,0 +1,16 @@ +import { useRef } from "react"; + +export interface GameCanvasProps { + width: number; + height: number; +} + +export const GameCanvas = ({ width, height }: GameCanvasProps) => { + const canvasRef = useRef<HTMLCanvasElement>(null); + + return ( + <div className="centered-game"> + <canvas ref={canvasRef} width={width} height={height}></canvas> + </div> + ); +}; |