Skip to content

Commit a03d70b

Browse files
authored
Merge pull request #39 from praneshr/react-key-fix
Use stable keys for react code folding nodes
2 parents 52b33e8 + 40d9e17 commit a03d70b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ class DiffViewer extends React.Component<ReactDiffViewerProps, ReactDiffViewerSt
403403
</td>
404404
);
405405
return (
406-
<tr key={Math.round(100).toString()} className={this.styles.codeFold}>
406+
<tr key={`${leftBlockLineNumber}-${rightBlockLineNumber}`} className={this.styles.codeFold}>
407407
{!this.props.hideLineNumbers && (
408408
<td className={this.styles.codeFoldGutter} />
409409
)}

0 commit comments

Comments
 (0)