Fix issue 408 (#411)

Summary:
Fix https://github.com/facebook/flipper/issues/408
Pull Request resolved: https://github.com/facebook/flipper/pull/411

Reviewed By: danielbuechele

Differential Revision: D14802001

Pulled By: jknoxville

fbshipit-source-id: 5ce435c0c941a715f799c75a8e09dbf4983e9789
This commit is contained in:
Zhang Qichuan
2019-04-11 04:36:12 -07:00
committed by Facebook Github Bot
parent 25f82986ea
commit ffc6a5fe18

View File

@@ -82,12 +82,17 @@ export default class Inspector extends Component<Props> {
}: { }: {
nodes: Array<{id: ElementID, children: Array<ElementID>}>, nodes: Array<{id: ElementID, children: Array<ElementID>}>,
}) => { }) => {
this.getNodes( const ids = nodes
nodes .map(n => [n.id, ...(n.children || [])])
.map(n => [n.id, ...(n.children || [])]) .reduce((acc, cv) => acc.concat(cv), []);
.reduce((acc, cv) => acc.concat(cv), []), this.getNodes(ids, {}).then(nodes => {
{}, nodes.forEach(node => {
); // Check if there are new IDs in the children array, and call getNodes()
// if there are any
const cIds = node.children.filter(c => !this.elements()[c]);
this.getNodes(cIds, {});
});
});
}, },
); );