summaryrefslogtreecommitdiff
path: root/src/components/GameCanvas.tsx
blob: ea93c64717cc90210455680f54627b11fc604e28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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>
  );
};