title: Filtering with React Sortable Tree
body: <p>I'm using react sortable tree and want to be able to filter. I'm getting the filtered nodes from our backend server then doing a reduce on the current tree to display filtered nodes. This part work fine but when I fetch children my tree state gets messed up and I suspect it could be due to javascript references.</p>
  
  <p>Code below:
  FilteredNodes is from server</p>
  
  <pre><code>static filterNodes = (map, processingStatuses, filteredNodes) =&gt; (newTree, node) =&gt; {
      const docNode = cloneDeep(TreeUtils.docNodeFromTreeNode(map, node));
      const thisNodePasses = filteredNodes.findIndex(findNode =&gt; findNode.id === docNode.id);
      if (thisNodePasses &gt;= 0) {
        newTree.push({ ...node });
        return newTree;
      }
  
      if (docNode.children &amp;&amp; docNode.children.length) {
        const filteredChildren = docNode.children.reduce(
          FilterUtils.filterNodes(map, processingStatuses, filteredNodes),
          [],
        );
        if (filteredChildren.length) {
          newTree.push({
            ...node,
            children: [...filteredChildren],
          });
        }
      }
  
      return newTree;
    }
  </code></pre>
  
  <pre><code>  static getFilteredTree = (tree, map, processingStatuses, filteredNodes) =&gt; {
  
      return filteredNodes.length ?
        tree.reduce(FilterUtils.filterNodes(map, processingStatuses, filteredNodes), []) : tree;
    }
  </code></pre>
  
  <p>How should I be handling filtering?</p>