1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
| import React, { useState, useRef, useEffect, useMemo } from "react";
| import Player from "../../map/player";
|
| let player;
|
| const Dashboard = () => {
| const mapRef = React.useRef();
|
|
| useEffect(() => {
| player = new Player(mapRef.current)
| }, [])
|
| return (
| <>
| <h1>Hello World</h1>
| <div ref={mapRef} ></div>
| </>
| )
| }
|
| export default Dashboard;
|
|