Skip to content

Commit 2589b27

Browse files
perf(web): the code view file reveal hook compiles without manual memoization
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 70d60e0 commit 2589b27

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

‎apps/web/reactCompiledFiles.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,5 @@ export const REACT_COMPILED_FILES = [
9696
"apps/web/src/components/pullRequest/PullRequestDetailPanel.tsx",
9797
"apps/web/src/components/ThreadTerminalDrawer.tsx",
9898
"apps/web/src/components/settings/SettingsPanels.tsx",
99+
"apps/web/src/components/diffs/useCodeViewFileReveal.ts",
99100
] as const;

‎apps/web/src/components/diffs/useCodeViewFileReveal.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { CodeViewScrollTarget } from "@pierre/diffs";
2-
import { useCallback, useEffect, useRef, useState } from "react";
2+
import { useEffect, useRef, useState } from "react";
33

44
interface FileRevealHandle {
55
getInstance(): object | undefined;
@@ -27,5 +27,5 @@ export function useCodeViewFileReveal<TScope>(
2727
handledRequest.current = request;
2828
}, [request, scope, viewer, readyFileKeys]);
2929

30-
return useCallback((fileKey: string) => setRequest({ fileKey, scope }), [scope]);
30+
return (fileKey: string) => setRequest({ fileKey, scope });
3131
}

0 commit comments

Comments
 (0)