react-sortable-tree
react-sortable-tree copied to clipboard
Wrong param name of the utils function
Why you named param - getNodeKey
? definitely, it is not node key, it is INDEX of the path! I spent 2 hours for figured out why it does not work then I went to the source code and seen that it is the index.
Should be getNodeKey: (item) => item.treeIndex,
but not getNodeKey: (item) => item.node.key,
changeNodeAtPath({
treeData,
path,
newNode,
getNodeKey // get path index but not node key
})