frontend-collective / frontend-collective/react-sortable-tree

Wrong param name of the utils function

Open
#879 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
5k
Forks
914
PR merge metrics
No merged PRs in 30d

Description

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,

```js
changeNodeAtPath({
treeData,
path,
newNode,
getNodeKey // get path index but not node key
})
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.