From 35c1f4d07f826a452e854ccf8190c523d0f88a25 Mon Sep 17 00:00:00 2001 From: Craig Reese <109101548+craigrva@users.noreply.github.com> Date: Tue, 12 Sep 2023 14:04:07 -0500 Subject: [PATCH] Dev support/appeals 29184 4958 (#19286) * 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 * 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 --------- Co-authored-by: Brandon Dorner --- client/app/components/AmaIssueList.jsx | 2 +- client/app/queue/components/TaskRows.jsx | 1 + 2 files changed, 2 insertions(+), 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} 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}` }); }