frontend-collective / frontend-collective/react-sortable-tree
rootKey in getTreeFromFlatData not behaving correctly for string based keys
- Dominant language
- JavaScript
- Stars
- 5k
- Forks
- 914
- PR merge metrics
- No merged PRs in 30d
Description
Hi, think I've found a bug,
When trying to use the getTreeFromFlat data function, and:
1. Your id's are global strings
2. Your tree doesn't have a rootKey
The function keeps returning back an empty array []
I think this is a bug in the function in the following code block
https://github.com/fritz-c/react-sortable-tree/blob/337a633e75a761f6a10bdf9ea0e2d06d82e603b9/src/utils/tree-data-utils.js#L993
I think this shouldn't return an empty array if no rootKey is give.
I've also tried setting it to '0' as per #189 but that's not helping either.
Any ideas what else it could be?
Thanks
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.