Skip to content

Commit fb0a790

Browse files
committed
react: update reference to backend's MyRoomState
1 parent 1fb44ea commit fb0a790

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pages/getting-started/react.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ Alternatively, you can use a React Context Provider to manage the connection and
6464
```typescript filename="RoomContext.tsx"
6565
import React, { createContext, useContext } from 'react';
6666
import { Room } from 'colyseus.js';
67+
import type { MyRoomState } from "../../backend/src/rooms/MyRoomState";
6768

6869
interface RoomContextType {
6970
isConnecting: boolean;
@@ -91,7 +92,7 @@ export function RoomProvider({ children }: { children: React.ReactNode }) {
9192
const [joinError, setJoinError] = React.useState(false);
9293
const [isConnecting, setIsConnecting] = React.useState(false);
9394
const [isConnected, setIsConnected] = React.useState(false);
94-
const [state, setState] = React.useState<ReturnType<BalootiState['toJSON']>>(undefined)
95+
const [state, setState] = React.useState<ReturnType<MyRoomState['toJSON']>>(undefined)
9596

9697
const join = () => {
9798
if (hasActiveJoinRequest) { return; }

0 commit comments

Comments
 (0)