diff --git a/src/components/Lose.tsx b/src/components/Lose.tsx index b710290..53ecfbd 100644 --- a/src/components/Lose.tsx +++ b/src/components/Lose.tsx @@ -1,8 +1,9 @@ -import { createRef, type Ref, Text, useScene } from 'phaser-jsx'; +import { createRef, Text, useScene } from 'phaser-jsx'; +import type { RefObject } from 'react'; interface Props { onClick: () => void; - ref: (ref: Ref) => void; + ref: (ref: RefObject) => void; } export function Lose(props: Props) { diff --git a/src/components/Win.tsx b/src/components/Win.tsx index deee977..ca291fa 100644 --- a/src/components/Win.tsx +++ b/src/components/Win.tsx @@ -1,10 +1,11 @@ -import { createRef, type Ref, Text, useScene } from 'phaser-jsx'; +import { createRef, Text, useScene } from 'phaser-jsx'; +import type { RefObject } from 'react'; import { Audio } from '../constants'; interface Props { onClick: () => void; - ref: (ref: Ref) => void; + ref: (ref: RefObject) => void; } export function Win(props: Props) { diff --git a/src/scenes/Main.tsx b/src/scenes/Main.tsx index 004d541..e33e415 100644 --- a/src/scenes/Main.tsx +++ b/src/scenes/Main.tsx @@ -1,5 +1,6 @@ import Phaser from 'phaser'; -import { type Ref, render } from 'phaser-jsx'; +import { render } from 'phaser-jsx'; +import type { RefObject } from 'react'; import { Lose, Title, Win } from '../components'; import { Audio, Image, Scene } from '../constants'; @@ -177,7 +178,7 @@ export class Main extends Phaser.Scene { } startGame() { - let winnerTextRef: Ref; + let winnerTextRef: RefObject; render( ; + let gameOverTextRef: RefObject; render(