From 88e2bb7607fd493631cff87f416172f351c579d1 Mon Sep 17 00:00:00 2001 From: Luke De Feo Date: Mon, 12 Dec 2022 07:28:37 -0800 Subject: [PATCH] Fix order of items Reviewed By: lawrencelomax Differential Revision: D41838169 fbshipit-source-id: 2cc82eb1d50552de5f7970b61f6375d6ff8985fd --- desktop/plugins/public/ui-debugger/components/Tree2.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/desktop/plugins/public/ui-debugger/components/Tree2.tsx b/desktop/plugins/public/ui-debugger/components/Tree2.tsx index 8d80f49ad..0d89f74b8 100644 --- a/desktop/plugins/public/ui-debugger/components/Tree2.tsx +++ b/desktop/plugins/public/ui-debugger/components/Tree2.tsx @@ -29,6 +29,7 @@ import { import {plugin} from '../index'; import {Glyph} from 'flipper'; import {head} from 'lodash'; +import {reverse} from 'lodash/fp'; export function Tree2({ nodes, @@ -255,12 +256,11 @@ function toTreeList( }); if (isExpanded) { - for (const childId of cur.children) { + //since we do dfs and use a stack we have to reverse children to get the order correct + for (const childId of reverse(cur.children)) { const child = nodes.get(childId); if (child != null) { stack.push([child, depth + 1]); - } else { - console.log('null', childId); } } }