Skip to content

Commit

Permalink
Fix react keys in stack actions
Browse files Browse the repository at this point in the history
Summary: Add missing `key` values to these components

Reviewed By: quark-zju

Differential Revision: D44115300

fbshipit-source-id: 632a40305aec6a3acce654076ab00b73406a60ae
  • Loading branch information
evangrayk authored and facebook-github-bot committed Mar 21, 2023
1 parent 4879d85 commit e6a0979
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions addons/isl/src/CommitTreeList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ function createSubtree(tree: CommitTreeWithPreviews, depth: number): Array<React
previewType={previewType}
hasChildren={renderedChildren.length > 0}
/>,
depth === 1 ? <StackActions tree={tree} /> : null,
depth === 1 ? <StackActions key="stack-actions" tree={tree} /> : null,
].filter(notEmpty);
}

Expand Down Expand Up @@ -230,7 +230,7 @@ function StackActions({tree}: {tree: CommitTreeWithPreviews}): React.ReactElemen
// any existing diffs -> show resubmit stack,
if (resubmittableStack != null && resubmittableStack.length >= MIN_STACK_SIZE_TO_SUGGEST_SUBMIT) {
actions.push(
<HighlightCommitsWhileHovering toHighlight={resubmittableStack}>
<HighlightCommitsWhileHovering key="resubmit-stack" toHighlight={resubmittableStack}>
<VSCodeButton
appearance="icon"
onClick={() => {
Expand All @@ -249,7 +249,7 @@ function StackActions({tree}: {tree: CommitTreeWithPreviews}): React.ReactElemen
) {
moreActions.push({
label: (
<HighlightCommitsWhileHovering toHighlight={submittableStack}>
<HighlightCommitsWhileHovering key="submit-entire-stack" toHighlight={submittableStack}>
<FlexRow>
<Icon icon="cloud-upload" slot="start" />
<T>Submit entire stack</T>
Expand All @@ -270,7 +270,7 @@ function StackActions({tree}: {tree: CommitTreeWithPreviews}): React.ReactElemen
) {
// NO existing diffs -> show submit stack ()
actions.push(
<HighlightCommitsWhileHovering toHighlight={submittableStack}>
<HighlightCommitsWhileHovering key="submit-stack" toHighlight={submittableStack}>
<VSCodeButton
appearance="icon"
onClick={() => {
Expand All @@ -287,7 +287,7 @@ function StackActions({tree}: {tree: CommitTreeWithPreviews}): React.ReactElemen
}
const moreActionsButton =
moreActions.length === 0 ? null : (
<VSCodeButton appearance="icon" onClick={contextMenu}>
<VSCodeButton key="more-actions" appearance="icon" onClick={contextMenu}>
<Icon icon="ellipsis" />
</VSCodeButton>
);
Expand Down

0 comments on commit e6a0979

Please sign in to comment.