react-folder-tree icon indicating copy to clipboard operation
react-folder-tree copied to clipboard

BUG: Component brokes if a data file has a key named `path`

Open baur opened this issue 3 years ago • 4 comments

Component brokes if a data file has a key named path

 {
        "name": "Проверка",
        "title": "Проверка",
        "path": "c:/PROJECTS/FileDATA/FileDATA/data",
        "fullname": "c:/PROJECTS/FileDATA/FileDATA/data/Проверка",
        "isDirectory": true,
        "children": [
            {
                "name": "159.pdf",
                "title": "159",
                "path": "c:/PROJECTS/FileDATA/FileDATA/data/Проверка",
                "fullname": "c:/PROJECTS/FileDATA/FileDATA/data/Проверка/159.pdf",
                "isDirectory": false
            },

baur avatar Jan 27 '22 04:01 baur

path with slash value /

baur avatar Jan 27 '22 05:01 baur

resolved with renaming key path to another

baur avatar Jan 27 '22 05:01 baur

hi, there is an internal key called path so will have some conflict https://github.com/shunjizhan/react-folder-tree#-custom-initial-state. And I should probably change the naming to something else to avoid such conflict, such as _path

shunjizhan avatar Feb 05 '22 07:02 shunjizhan

image

Hello. Same error here

image

There is no 'path' key in my data image

marry1822 avatar Feb 27 '24 05:02 marry1822