Skip to content

Commit a344f77

Browse files
authored
fix wide banner bug (#205)
1 parent d633a0c commit a344f77

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

ts/CodeDiffContainer.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ async function getOrNull(side: string, path: string) {
8383
// A side-by-side diff of source code.
8484
export function CodeDiffContainer(props: {filePair: FilePair; diffOptions: Partial<DiffOptions>}) {
8585
const {filePair, diffOptions} = props;
86-
const codediffRef = React.useRef<HTMLDivElement>(null);
8786
const [contents, setContents] = React.useState<
8887
{before: string | null; after: string | null; diffOps: DiffRange[]} | undefined
8988
>();
@@ -119,8 +118,7 @@ export function CodeDiffContainer(props: {filePair: FilePair; diffOptions: Parti
119118

120119
return (
121120
<div>
122-
<NoChanges filePair={filePair} />
123-
<div ref={codediffRef} key={filePair.idx}>
121+
<div key={filePair.idx}>
124122
{contents ? (
125123
<FileDiff
126124
filePair={filePair}
@@ -192,6 +190,7 @@ function FileDiff(props: FileDiffProps) {
192190

193191
return (
194192
<div className="diff">
193+
<NoChanges filePair={filePair} />
195194
<CodeDiff
196195
beforeText={contentsBefore}
197196
afterText={contentsAfter}

0 commit comments

Comments
 (0)