From 01deb97a5dfbffb304c612cfa118b6350633d7b0 Mon Sep 17 00:00:00 2001 From: John Knox Date: Tue, 3 Dec 2019 06:27:07 -0800 Subject: [PATCH] Add keys to FeedbackComponent array elements Summary: Was getting a react warning whenever the feedback prompt opens. This stops it from happening. Reviewed By: mweststrate Differential Revision: D18780008 fbshipit-source-id: e4635f7a8322e25a3eea1c201974a100d1f1327a --- src/chrome/RatingButton.tsx | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/chrome/RatingButton.tsx b/src/chrome/RatingButton.tsx index c6dc88c70..873504624 100644 --- a/src/chrome/RatingButton.tsx +++ b/src/chrome/RatingButton.tsx @@ -95,7 +95,7 @@ const Spacer = styled(FlexColumn)({ function dismissRow(dismiss: () => void) { return ( - + Dismiss @@ -204,16 +204,19 @@ class FeedbackComponent extends Component< switch (this.state.nextAction) { case 'select-rating': body = [ - {this.props.promptData.bodyText}, - {stars}, + {this.props.promptData.bodyText}, + + {stars} + , dismissRow(this.props.dismiss), ]; break; case 'leave-comment': const predefinedComments = Object.entries( this.state.predefinedComments, - ).map((c: [string, unknown]) => ( + ).map((c: [string, unknown], idx: number) => ( @@ -227,8 +230,8 @@ class FeedbackComponent extends Component< /> )); body = [ - {predefinedComments}, - + {predefinedComments}, + , - + {'Tool owner can contact me '} , - + @@ -256,7 +259,7 @@ class FeedbackComponent extends Component< ]; break; case 'finished': - body = [Thanks!]; + body = [Thanks!]; break; default: { console.error('Illegal state: nextAction: ' + this.state.nextAction); @@ -272,7 +275,7 @@ class FeedbackComponent extends Component< paddingTop: 10, paddingBottom: 10, }}> - + {this.state.nextAction === 'finished' ? this.props.promptData.postSubmitHeading : this.props.promptData.preSubmitHeading}