How to use the react-sortable-tree.walk 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 MetaCell / NetPyNE-UI / webapp / components / general / FileBrowser.js View on Github external
getSelectedFiles () {
    const nodes = {}
    if (!this.refs.tree) {
      return nodes
    }
    walk({
      treeData: this.refs.tree.state.treeData,
      getNodeKey: ({ treeIndex }) => treeIndex,
      ignoreCollapsed: true,
      callback: rowInfoIter => {
        if (rowInfoIter.node.active) {
          nodes[rowInfoIter.treeIndex] = rowInfoIter.node
        }
      }
    });

    return nodes
  }