44 type FileDiffMetadata ,
55} from "@pierre/diffs" ;
66import { FileDiff } from "@pierre/diffs/react" ;
7- import { useMemo } from "react" ;
87
98import { useTheme } from "~/hooks/useTheme" ;
109import { resolveDiffThemeName } from "~/lib/diffRendering" ;
@@ -22,21 +21,18 @@ export function GuideFileDiff({
2221 const { resolvedTheme } = useTheme ( ) ;
2322 // Loading the unchanged lines rewrites the diff it is given; the excerpts read the same file
2423 // as a patch, so this view expands a copy of its own.
25- const expandable = useMemo ( ( ) => cloneFileDiffMetadata ( file ) , [ file ] ) ;
26- const options = useMemo (
27- ( ) => ( {
28- diffStyle : "unified" as const ,
29- lineDiffType : "none" as const ,
30- overflow : "scroll" as const ,
31- disableFileHeader : true ,
32- theme : resolveDiffThemeName ( resolvedTheme ) ,
33- themeType : resolvedTheme ,
34- preferredHighlighter : PREFERRED_HIGHLIGHTER ,
35- unsafeCSS : DIFF_VIEW_UNSAFE_CSS ,
36- loadDiffFiles,
37- } ) ,
38- [ loadDiffFiles , resolvedTheme ] ,
39- ) ;
24+ const expandable = cloneFileDiffMetadata ( file ) ;
25+ const options = {
26+ diffStyle : "unified" as const ,
27+ lineDiffType : "none" as const ,
28+ overflow : "scroll" as const ,
29+ disableFileHeader : true ,
30+ theme : resolveDiffThemeName ( resolvedTheme ) ,
31+ themeType : resolvedTheme ,
32+ preferredHighlighter : PREFERRED_HIGHLIGHTER ,
33+ unsafeCSS : DIFF_VIEW_UNSAFE_CSS ,
34+ loadDiffFiles,
35+ } ;
4036 return (
4137 < div className = "border-t border-border/60" >
4238 < FileDiff fileDiff = { expandable } options = { options } />
0 commit comments