Skip to content

Commit 39ad9c6

Browse files
perf(web): the snapshot shortcut recorder compiles without manual memoization
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent a702563 commit 39ad9c6

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎apps/web/src/components/settings/useSnapShotShortcutRecorder.tsx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
type SnapShotShortcut,
55
} from "@t3tools/contracts";
66
import { parseKeybindingShortcut } from "@t3tools/shared/keybindings";
7-
import { useCallback, useEffect, useRef, useState, type KeyboardEvent } from "react";
7+
import { useEffect, useRef, useState, type KeyboardEvent } from "react";
88
import { getDesktopSnapShotBridge } from "../../lib/desktopSnapShot";
99
import {
1010
formatSnapShotShortcutLabel,
@@ -52,12 +52,12 @@ export function useSnapShotShortcutRecorder({
5252
const [recording, setRecording] = useState(false);
5353
const [requests] = useState(createRecordingRequestTracker);
5454
const heldModifierCodes = useRef(new Set<string>());
55-
const stopRecording = useCallback(() => {
55+
const stopRecording = () => {
5656
requests.clear();
5757
heldModifierCodes.current.clear();
5858
setRecording(false);
5959
void bridge?.setSnapShotShortcutSuppressed(false).catch(() => undefined);
60-
}, [bridge, requests]);
60+
};
6161
const startRecording = async () => {
6262
if (!bridge || disabled) return;
6363
const request = requests.tryBegin();

0 commit comments

Comments
 (0)