Skip to content

Commit

Permalink
fix(ui): use index as key of list of components to make sure the ui d…
Browse files Browse the repository at this point in the history
…oesn't fail when a type gets processed multiple times (#178)
  • Loading branch information
Pmyl committed Jan 15, 2020
1 parent 0238e97 commit 84a52a1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ui/src/app/definitelyTyped/definitelyTyped.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ export function DefinitelyTyped(): JSX.Element {
return <option key={index} value={run.id}>Run on date {run.date.toISOString()}</option>;
});

const types: JSX.Element[] = !viewData ? [] : viewData.map((d) => {
return <details key={d.item} className={mapResponseToClassName(d.response)}>
const types: JSX.Element[] = !viewData ? [] : viewData.map((d: DefinitelyTypedTypeRun, index: number) => {
return <details key={index} className={mapResponseToClassName(d.response)}>
<summary><span>{d.item}</span></summary>
<pre>{d.message}</pre>
</details>;
Expand Down

0 comments on commit 84a52a1

Please sign in to comment.