diff options
Diffstat (limited to 'src/components/GameCanvas.tsx')
-rw-r--r-- | src/components/GameCanvas.tsx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/components/GameCanvas.tsx b/src/components/GameCanvas.tsx index 5cb40a6..0ea7180 100644 --- a/src/components/GameCanvas.tsx +++ b/src/components/GameCanvas.tsx @@ -8,10 +8,10 @@ export interface GameCanvasProps { export const GameCanvas = ({ width, height }: GameCanvasProps) => { const canvasRef = useRef<HTMLCanvasElement>(null); - const [_game, setGame] = useState<TheAbstractionEngine>(); + const [game, setGame] = useState<TheAbstractionEngine>(); useEffect(() => { - if (canvasRef.current) { + if (canvasRef.current && !game) { const canvas = canvasRef.current; const ctx = canvas.getContext("2d"); if (ctx) { |