Hi. in the reactJs, how can append game canvas to the element ?
i need to render game in the element.
Let me clearly, how can render phaser in a simple react class ?
import React from "react";
import Phaser from "phaser";
class Game extends React.Component {
constructor(props) {
super(props);
this.state = {};
}
componentDidMount() {
let game = new Phaser.Game({
type: Phaser.AUTO,
width: 600,
height: 400,
});
}
render(){
return(
<>
Game can here
</>
);
}
}