Add Button with each node on rc-tree

(Dineshtw) #1

Hi ,
I am referring on example of rc-tree , where I need to show link or button on each node of rc-tree(TreeNode), but I am unable to show button .below is rc-tree example link.
http://react-component.github.io/tree/examples/basic.html.
See below my code snippet.
const customLabel = (data) => {
//if (data.type == “folder”) {

        <span>
            <span>{data.title}</span>
            <span style={{ color: '#EB0000' }} >X</span>
        </span>
         }

and tree node is.
return childData.map((item) => {
if (item.children) {
if (item.type == “folder”) {
return (

                        <TreeNode title={customLabel(title)} ref={item.title} key={item.id} >
                            {loop(item.children)}
                            </TreeNode>
                       
                    )
                       
                    }

Could you help me to solve my Issue.

0 Likes