Skip to content

Commit

Permalink
Dev support/appeals 29184 4958 (#19286)
Browse files Browse the repository at this point in the history
* 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 <brandonleedorner@gmail.com>
  • Loading branch information
craigrva and brandondorner authored Sep 12, 2023
1 parent a101931 commit 35c1f4d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion client/app/components/AmaIssueList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default class AmaIssueList extends React.PureComponent {
{requestIssues.map((issue, i) => {
const error = errorMessages && errorMessages[issue.id];

return <React.Fragment>
return <React.Fragment key={`ama-issue-${i}`}>
{ error &&
<span className="usa-input-error-message" tabIndex={0}>
{error}
Expand Down
1 change: 1 addition & 0 deletions client/app/queue/components/TaskRows.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,7 @@ class TaskRows extends React.PureComponent {
timeline,
taskList,
index,
key: `${timelineEvent?.type}-${index}`
});
}

Expand Down

0 comments on commit 35c1f4d

Please sign in to comment.