Skip to content
This repository was archived by the owner on Nov 18, 2024. It is now read-only.

Commit 6ef5cc3

Browse files
committed
more fixes, more rebase
1 parent 4d36cf5 commit 6ef5cc3

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/components/DiffView/index.spec.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
/// <reference path="index.d.ts"/>
1+
// / <reference path="index.d.ts"/>
22

3-
import { shallow } from 'enzyme';
3+
import { ShallowWrapper, shallow } from 'enzyme';
44
import React from 'react';
55
import { Diff, parseDiff } from 'react-diff-view';
66

@@ -19,7 +19,7 @@ index 5ca1a30..4e2c90f 100644
1919
+ expect(root).toHaveProp('viewType', viewType);
2020
});`;
2121

22-
const render = (props = {}) => {
22+
const render = (props = {}): ShallowWrapper => {
2323
return shallow(<DiffView diff={basicDiff} {...props} />);
2424
};
2525

src/components/DiffView/index.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,13 @@ class DiffView extends React.Component<Props> {
2020
return (
2121
<div>
2222
{files.map(({ hunks, type }, index: number) => (
23-
<Diff diffType={type} hunks={hunks} key={index} viewType={viewType} />
23+
<Diff
24+
diffType={type}
25+
hunks={hunks}
26+
// eslint-disable-next-line react/no-array-index-key
27+
key={`diff-${index}`}
28+
viewType={viewType}
29+
/>
2430
))}
2531
</div>
2632
);

0 commit comments

Comments
 (0)