How to use the react-sortable-tree.getNodeAtPath function in react-sortable-tree

To help you get started, we’ve selected a few react-sortable-tree examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github virena-app / virena / src / utils / populateImg.js View on Github external
if(selected.children[0].subtitle === 'BottomTab') 
            return `${image}/Tab-Drawer/${selected.children.length}TabDrawer.png`;
            
          return populateImg(image, selected.children[0])
        }
      
      case 'Simple Screen':
      // if(selected.children && selected.children.length) 
        // return `${image}/Screen/${selected.children.length}screen.png`;
        //trying to get the parent so i can access the children.length on the tree
        //selected.path === [0, 1];
        
        console.log('case ss: path', 
        treeData, 
        selected,
        getNodeAtPath({
          treeData, 
          path: selected.path.slice(0, selected.path.length), 
          getNodeKey: selected.key,
          ignoreCollapsed
        })
        );
      case 'Stack':
        break;
      
      case 'Switch':
        return image += 'switch.png';
      
      default:
        return image += 'default.png'
    }