Bug 1540741 - Warning: Each child in an array or iterator should have a unique "key" prop. r=davidwalsh
authorJan Odvarko <odvarko@gmail.com>
Fri, 12 Apr 2019 12:02:45 +0000
changeset 469265 650ab6bfa91aca539aecc86fd73aff5d9e32b07e
parent 469264 4b8cb5cb5d7a841bf3761868a96313a2fa1ce71e
child 469266 2e0165dcfdb1c104551d75c5ff4833cd064e6405
push id112776
push usershindli@mozilla.com
push dateFri, 12 Apr 2019 16:20:17 +0000
treeherdermozilla-inbound@b4501ced5619 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdavidwalsh
bugs1540741
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1540741 - Warning: Each child in an array or iterator should have a unique "key" prop. r=davidwalsh Differential Revision: https://phabricator.services.mozilla.com/D25743
devtools/client/debugger/src/components/PrimaryPanes/SourcesTree.js
devtools/client/debugger/src/components/PrimaryPanes/tests/__snapshots__/SourcesTree.spec.js.snap
devtools/client/debugger/src/components/SecondaryPanes/index.js
--- a/devtools/client/debugger/src/components/PrimaryPanes/SourcesTree.js
+++ b/devtools/client/debugger/src/components/PrimaryPanes/SourcesTree.js
@@ -307,25 +307,25 @@ class SourcesTree extends Component<Prop
     const { worker, workerCount } = this.props;
 
     if (!features.windowlessWorkers || workerCount == 0) {
       return null;
     }
 
     if (worker) {
       return (
-        <div className="node thread-header">
+        <div className="node thread-header" key="thread-header">
           <AccessibleImage className="worker" />
           <span className="label">{getDisplayName(worker)}</span>
         </div>
       );
     }
 
     return (
-      <div className="node thread-header">
+      <div className="node thread-header" key="thread-header">
         <AccessibleImage className={"file"} />
         <span className="label">{L10N.getStr("mainThread")}</span>
       </div>
     );
   }
 
   render() {
     const { worker } = this.props;
--- a/devtools/client/debugger/src/components/PrimaryPanes/tests/__snapshots__/SourcesTree.spec.js.snap
+++ b/devtools/client/debugger/src/components/PrimaryPanes/tests/__snapshots__/SourcesTree.spec.js.snap
@@ -2,16 +2,17 @@
 
 exports[`SourcesTree After changing expanded nodes Shows the tree with four.js, five.js and six.js expanded 1`] = `
 <div
   className="sources-pane thread"
   key="pane"
 >
   <div
     className="node thread-header"
+    key="thread-header"
   >
     <AccessibleImage
       className="file"
     />
     <span
       className="label"
     >
       Main Thread
@@ -50,16 +51,17 @@ exports[`SourcesTree After changing expa
 
 exports[`SourcesTree Should show a 'No Sources' message if there are no sources 1`] = `
 <div
   className="sources-pane thread"
   key="pane"
 >
   <div
     className="node thread-header"
+    key="thread-header"
   >
     <AccessibleImage
       className="file"
     />
     <span
       className="label"
     >
       Main Thread
@@ -76,16 +78,17 @@ exports[`SourcesTree Should show a 'No S
 
 exports[`SourcesTree Should show the tree with nothing expanded 1`] = `
 <div
   className="sources-pane thread"
   key="pane"
 >
   <div
     className="node thread-header"
+    key="thread-header"
   >
     <AccessibleImage
       className="file"
     />
     <span
       className="label"
     >
       Main Thread
@@ -117,16 +120,17 @@ exports[`SourcesTree Should show the tre
 
 exports[`SourcesTree When loading initial source Shows the tree with one.js, two.js and three.js expanded 1`] = `
 <div
   className="sources-pane thread"
   key="pane"
 >
   <div
     className="node thread-header"
+    key="thread-header"
   >
     <AccessibleImage
       className="file"
     />
     <span
       className="label"
     >
       Main Thread
@@ -165,16 +169,17 @@ exports[`SourcesTree When loading initia
 
 exports[`SourcesTree on receiving new props updates highlighted items updates highlightItems if selectedSource changes 1`] = `
 <div
   className="sources-pane thread"
   key="pane"
 >
   <div
     className="node thread-header"
+    key="thread-header"
   >
     <AccessibleImage
       className="file"
     />
     <span
       className="label"
     >
       Main Thread
--- a/devtools/client/debugger/src/components/SecondaryPanes/index.js
+++ b/devtools/client/debugger/src/components/SecondaryPanes/index.js
@@ -231,17 +231,17 @@ class SecondaryPanes extends Component<P
       !features.mapScopes ||
       !selectedFrame ||
       isGeneratedId(selectedFrame.location.sourceId)
     ) {
       return null;
     }
 
     return [
-      <div>
+      <div key="scopes-buttons">
         <label
           className="map-scopes-header"
           title={L10N.getStr("scopes.mapping.label")}
           onClick={e => e.stopPropagation()}
         >
           <input
             type="checkbox"
             checked={shouldMapScopes ? "checked" : ""}