Ant Design

Date: 2021-01-08

Loop through nodes in Tree

https://ant.design/components/overview/

const valueMap = {};
function loops(list, parent) {
  return (list || []).map(({ children, value }) => {
    const node = (valueMap[value] = {
      parent,
      value
    });
    node.children = loops(children, node);
    return node;
  });
}

loops(treeData);
44190cookie-checkAnt Design