@samitouri / QOS-React / commits / 037071c0e1

Remove root from "roots" list on unmount

Brian Vaughn committed Jan 30, 2019 at 10:41 UTC 037071c0e11fbf9e5626e95cab8ac3e1d7284659
1 file changed +3 -1
src/devtools/store.js
+3 -1
@@ -213,7 +213,9 @@ export default class Store extends EventEmitter {
213 this._idToElement.delete(id);
214
215 parentElement = ((this._idToElement.get(parentID): any): Element);
216 - if (parentElement != null) {
216 + if (parentElement == null) {
217 + this._roots = this._roots.filter(rootID => rootID !== id);
218 + } else {
219 parentElement.children = parentElement.children.filter(
220 childID => childID !== id
221 );