File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ new Phaser.Game({
3535
3636Without JSX:
3737
38- ``` js
38+ ``` ts
3939// index.js
4040import Phaser from ' phaser' ;
4141import { jsx , render } from ' phaser-jsx' ;
@@ -74,13 +74,13 @@ yarn add phaser-jsx
7474
7575ES Modules:
7676
77- ``` js
77+ ``` ts
7878import { createElement , render } from ' phaser-jsx' ;
7979```
8080
8181CommonJS:
8282
83- ``` js
83+ ``` ts
8484const { createElement, render } = require (' phaser-jsx' );
8585```
8686
@@ -126,7 +126,7 @@ Update your `tsconfig.json`:
126126
127127Update your Vite config:
128128
129- ``` js
129+ ``` ts
130130// vite.config.mjs
131131import { defineConfig } from ' vite' ;
132132
@@ -165,9 +165,9 @@ If you need nesting and relative positioning, use `Container`:
165165
166166### ` useScene `
167167
168- If you have a single Scene, retrieve it with the ` useScene ` hook:
168+ Retrieve the current Scene with the ` useScene ` hook:
169169
170- ``` js
170+ ``` ts
171171import { useScene } from ' phaser-jsx' ;
172172
173173function MyComponent() {
@@ -179,7 +179,7 @@ function MyComponent() {
179179> [ !WARNING]
180180> Don't use the ` useScene ` hook if you start multiple Scenes.
181181
182- To specify a Scene class in TypeScript:
182+ Type your Scene with TypeScript:
183183
184184``` ts
185185class MyScene extends Phaser .Scene {
You can’t perform that action at this time.
0 commit comments