File tree 3 files changed +10
-7
lines changed
3 files changed +10
-7
lines changed Original file line number Diff line number Diff line change 1
- import { createRef , type Ref , Text , useScene } from 'phaser-jsx' ;
1
+ import { createRef , Text , useScene } from 'phaser-jsx' ;
2
+ import type { RefObject } from 'react' ;
2
3
3
4
interface Props {
4
5
onClick : ( ) => void ;
5
- ref : ( ref : Ref < Phaser . GameObjects . Text > ) => void ;
6
+ ref : ( ref : RefObject < Phaser . GameObjects . Text | null > ) => void ;
6
7
}
7
8
8
9
export function Lose ( props : Props ) {
Original file line number Diff line number Diff line change 1
- import { createRef , type Ref , Text , useScene } from 'phaser-jsx' ;
1
+ import { createRef , Text , useScene } from 'phaser-jsx' ;
2
+ import type { RefObject } from 'react' ;
2
3
3
4
import { Audio } from '../constants' ;
4
5
5
6
interface Props {
6
7
onClick : ( ) => void ;
7
- ref : ( ref : Ref < Phaser . GameObjects . Text > ) => void ;
8
+ ref : ( ref : RefObject < Phaser . GameObjects . Text | null > ) => void ;
8
9
}
9
10
10
11
export function Win ( props : Props ) {
Original file line number Diff line number Diff line change 1
1
import Phaser from 'phaser' ;
2
- import { type Ref , render } from 'phaser-jsx' ;
2
+ import { render } from 'phaser-jsx' ;
3
+ import type { RefObject } from 'react' ;
3
4
4
5
import { Lose , Title , Win } from '../components' ;
5
6
import { Audio , Image , Scene } from '../constants' ;
@@ -177,7 +178,7 @@ export class Main extends Phaser.Scene {
177
178
}
178
179
179
180
startGame ( ) {
180
- let winnerTextRef : Ref < Phaser . GameObjects . Text > ;
181
+ let winnerTextRef : RefObject < Phaser . GameObjects . Text | null > ;
181
182
182
183
render (
183
184
< Win
@@ -187,7 +188,7 @@ export class Main extends Phaser.Scene {
187
188
this ,
188
189
) ;
189
190
190
- let gameOverTextRef : Ref < Phaser . GameObjects . Text > ;
191
+ let gameOverTextRef : RefObject < Phaser . GameObjects . Text | null > ;
191
192
192
193
render (
193
194
< Lose
You can’t perform that action at this time.
0 commit comments