Skip to content

Commit

Permalink
Add unique key to each table row to stop react complaining
Browse files Browse the repository at this point in the history
  • Loading branch information
callumforrester committed Jun 6, 2024
1 parent e8e388b commit a14c038
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ function App() {
);
}
return {
id: message._id,
timestamp: timestamp,
host: message.source,
level: log_levels[message.level],
Expand Down Expand Up @@ -135,6 +136,7 @@ function App() {
{logTable.map(row => {
return (
<TableRow
key={row.id}
sx={{
backgroundColor: colors[row.level] || colors.default,
}}
Expand Down
1 change: 1 addition & 0 deletions src/schema/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export interface PayloadSearchType {
}

export interface LogTableRow {
id: string;
timestamp: string;
host: string;
level: string;
Expand Down

0 comments on commit a14c038

Please sign in to comment.