Skip to content

Commit 5269291

Browse files
fix: useSWRConfig for mutate (#42)
1 parent dcc0613 commit 5269291

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

game/src/components/game.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@ import {
1212
StorageKey,
1313
} from "@/rpc/storage";
1414
import { useEffect, useRef } from "react";
15-
import { mutate } from "swr";
15+
import { useSWRConfig } from "swr";
1616
import { PAST_GAME_KEY } from "./past-games/past-games";
1717

1818
const NAV_WIDTH = 80;
1919
const LOOP_INTERVAL = 1000;
2020
export const Game = () => {
2121
const { submit } = useAction();
22+
const { mutate } = useSWRConfig();
2223
const tickRecorder = useRef<TickRecorder>();
2324
const isStarting = useRef<boolean>(false);
2425
const isEnding = useRef<boolean>(false);

0 commit comments

Comments
 (0)