score:1

Accepted answer
constructor(props) {
   super(props);
   this.myRef = {};
}
onCheck = (checkedKeys, event) => {
   how can get node checked??? it always returns last node 
   const checkedKey = // get the checkedKey here, if its a array, loop and use
   const node = this.myRef[checkedKey];
   console.log(node)
}

render() {
    const loop = (data) => {
        return data.map((item, index) => {
            if (item.children && item.children.length) {
                return <TreeNode ref={(ref) => this.myRef[key] = ref} title={item.name} key={item.key} checked={item.checked} >{loop(item.children)}</TreeNode>;
            }
            return (
                <TreeNode ref={(ref) => this.myRef[key] = ref} title={item.name} key={item.key} isLeaf={item.isLeaf} checked={item.checked}  />
            );
        });
    };
    return (
        <div className="draggable-container">
            <Tree
                // Expand
                expandedKeys={this.state.expandedKeys}
                onExpand={this.onExpand} autoExpandParent={this.state.autoExpandParent}
                // Draggable
                draggable
                onDragStart={this.onDragStart}
                onDragEnter={this.onDragEnter}
                onDrop={this.onDrop}
                // Select && Check
                onSelect={this.onSelect}
                checkable onCheck={this.onCheck} checkedKeys={this.state.checkedKeys} >
                { loop(this.state.treeData) }
            </Tree>
        </div>  
    );
}

score:0

[
    {
        "name": "Capas1",
        "key": "0-23",
        "isLeaf": false,
        "type": "folder",
        "expanded": true,
        "children": [{
                "name": "sectores",
                "key": "0-20",
                "isLeaf": true,
                "type": "layer",
                "checked": true
            },
            {
                "name": "distribucion",
                "key": "0-22",
                "isLeaf": true,
                "type": "layer",
                "checked": false
            }]
    }, 
    {
        "name": "Nueva Carpeta0",
        "key": "0-624",
        "isLeaf": false,
        "type": "folder",
        "expanded": false,
        "checked": false
    },
    {
        "name": "Nueva Carpeta1",
        "key": "0-625",
        "isLeaf": false,
        "type": "folder",
        "expanded": true,
        "children": [{
                "name": "Nueva Carpeta2",
                "key": "0-629",
                "isLeaf": false,
                "type": "folder",
                "expanded": true,
                "children": [{
                    "name": "Nueva Carpeta3",
                    "key": "0-623",
                    "isLeaf": false,
                    "type": "folder",
                    "expanded": true,
                    "children": [{
                        "name": "distribucion33",
                        "key": "0-99",
                        "isLeaf": true,
                        "type": "layer",
                        "checked": true
                    }]
                }]
            }]
    },
    {
        "name": "sectores1",
        "key": "0-27",
        "isLeaf": true,
        "type": "layer",
        "checked": true
    },
    {
        "name": "sectores12",
        "key": "0-89",
        "isLeaf": true,
        "type": "layer",
        "checked": false
    },
    {
        "name": "Capas 2",
        "key": "0-588",
        "isLeaf": false,
        "type": "folder",
        "expanded": false,
        "children": [{
            "name": "Capas 3",
            "key": "0-589",
            "isLeaf": false,
            "type": "folder",
            "expanded": false,
            "children": [{
                "name": "Prueba",
                "key": "0-36",
                "isLeaf": true,
                "type": "layer",
                "checked": false
                }]
            }]
    }
]

Related Query

More Query from same tag