From 60b3c98884c466866aa57a7ca92876ee814578aa Mon Sep 17 00:00:00 2001 From: Brandon Dorner Date: Thu, 24 Aug 2023 16:45:13 -0500 Subject: [PATCH 1/2] Add key prop to `TaskRows` timeline components This is a tech-debt task and should not change any functionality. https://jira.devops.va.gov/browse/APPEALS-4958 The timeline components were missing a key prop which was throwing a React error `Warning: Each child in a list should have a unique "key" prop.` In an effort to reduce errors and increase performance we have added in these component keys. Further reading on why React keys are important: https://dev.to/francodalessio/understanding-the-importance-of-the-key-prop-in-react-3ag7 --- client/app/queue/components/TaskRows.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/client/app/queue/components/TaskRows.jsx b/client/app/queue/components/TaskRows.jsx index 423aef3772b..343e9db01cd 100644 --- a/client/app/queue/components/TaskRows.jsx +++ b/client/app/queue/components/TaskRows.jsx @@ -532,6 +532,7 @@ class TaskRows extends React.PureComponent { timeline, taskList, index, + key: `${timelineEvent?.type}-${index}` }); } From 0b6b5398d8f9c2a615211127f97a05d754f50000 Mon Sep 17 00:00:00 2001 From: Brandon Dorner Date: Mon, 28 Aug 2023 11:22:54 -0500 Subject: [PATCH 2/2] Add key to `AmaIssueList` This is a tech-debt task and should not change any functionality. https://jira.devops.va.gov/browse/APPEALS-29184 `AmaIssueList` was missing a key prop which was throwing a React error `Warning: Each child in a list should have a unique "key" prop.` In an effort to reduce errors and increase performance we have added in these component keys. Further reading on why React keys are important: https://dev.to/francodalessio/understanding-the-importance-of-the-key-prop-in-react-3ag7 --- client/app/components/AmaIssueList.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/app/components/AmaIssueList.jsx b/client/app/components/AmaIssueList.jsx index 45a5fba8938..e4bd42001ec 100644 --- a/client/app/components/AmaIssueList.jsx +++ b/client/app/components/AmaIssueList.jsx @@ -62,7 +62,7 @@ export default class AmaIssueList extends React.PureComponent { {requestIssues.map((issue, i) => { const error = errorMessages && errorMessages[issue.id]; - return + return { error && {error}