Bug 1576652 - Remove unused state in Debugger's Accordion component; r=jlast
authorFlorens Verschelde <florens@fvsch.com>
Mon, 26 Aug 2019 21:53:00 +0000
changeset 551115 3b11b55b1c97e81a38268a308d9ab422835ff79d
parent 551114 212bfffe0a67c43e2c622a74b0009f182bbb6ffc
child 551116 2fa81d89b660198144d8c2f98c7f5043351d2766
push id11865
push userbtara@mozilla.com
push dateMon, 02 Sep 2019 08:54:37 +0000
treeherdermozilla-beta@37f59c4671b3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjlast
bugs1576652
milestone70.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 1576652 - Remove unused state in Debugger's Accordion component; r=jlast Differential Revision: https://phabricator.services.mozilla.com/D43492
devtools/client/debugger/src/components/shared/Accordion.js
--- a/devtools/client/debugger/src/components/shared/Accordion.js
+++ b/devtools/client/debugger/src/components/shared/Accordion.js
@@ -16,30 +16,17 @@ type AccordionItem = {
   className: string,
   opened: boolean,
   onToggle?: () => void,
   shouldOpen?: () => void,
 };
 
 type Props = { items: Array<Object> };
 
-type State = {
-  opened: boolean[],
-  created: boolean[],
-};
-
-class Accordion extends Component<Props, State> {
-  constructor(props: Props) {
-    super(props);
-    this.state = {
-      opened: props.items.map(item => item.opened),
-      created: [],
-    };
-  }
-
+class Accordion extends Component<Props> {
   handleHeaderClick(i: number) {
     const item = this.props.items[i];
     const opened = !item.opened;
     item.opened = opened;
 
     if (item.onToggle) {
       item.onToggle(opened);
     }