17 lines
364 B
TypeScript
Raw Normal View History

2024-03-01 16:31:27 -07:00
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>
);
};