diff --git a/src/Components/ElementsSidebar/ElementsSidebar.tsx b/src/Components/ElementsSidebar/ElementsSidebar.tsx index b710ae3..9f8bcc9 100644 --- a/src/Components/ElementsSidebar/ElementsSidebar.tsx +++ b/src/Components/ElementsSidebar/ElementsSidebar.tsx @@ -26,7 +26,8 @@ export class ElementsSidebar extends React.Component { handleContainer(container); - container.props.children.forEach((child) => { + // if this reverse() gets costly, replace it by a simple for + container.props.children.reverse().forEach((child) => { if (visited.has(child)) { return; }