Skip to content
TypeScript

perf(web): the snapshot shortcut recorder compiles without manual memoization (#20682)

Julius Marminge2ff8e7413b75
diff --git a/apps/web/src/components/settings/useSnapShotShortcutRecorder.tsx b/apps/web/src/components/settings/useSnapShotShortcutRecorder.tsx
index 2d3c693aef2..b59789274b9 100644
--- a/apps/web/src/components/settings/useSnapShotShortcutRecorder.tsx
+++ b/apps/web/src/components/settings/useSnapShotShortcutRecorder.tsx
@@ -4,7 +4,7 @@ import {
type SnapShotShortcut,
} from "@t3tools/contracts";
import { parseKeybindingShortcut } from "@t3tools/shared/keybindings";
-import { useCallback, useEffect, useRef, useState, type KeyboardEvent } from "react";
+import { useEffect, useRef, useState, type KeyboardEvent } from "react";
import { getDesktopSnapShotBridge } from "../../lib/desktopSnapShot";
import {
formatSnapShotShortcutLabel,
@@ -52,12 +52,12 @@ export function useSnapShotShortcutRecorder({
const [recording, setRecording] = useState(false);
const [requests] = useState(createRecordingRequestTracker);
const heldModifierCodes = useRef(new Set<string>());
- const stopRecording = useCallback(() => {
+ const stopRecording = () => {
requests.clear();
heldModifierCodes.current.clear();
setRecording(false);
void bridge?.setSnapShotShortcutSuppressed(false).catch(() => undefined);
- }, [bridge, requests]);
+ };
const startRecording = async () => {
if (!bridge || disabled) return;
const request = requests.tryBegin();