`children` of Tree is deprecated. Please use `treeData` instead.
<Tree className="file-tree" expandedKeys={expandedKeys} selectedKeys={selectedKeys} onSelect={this.handleClick} onExpand={this.handleExpand} > {files.map(createNode)} </Tree>
我需要自定义TreeNode的title,使用这种模式会出现上面的警告信息
[email protected]
+1 Getting the same issue.
Warning: 'children' of Tree is deprecated. Please use 'treeData' instead.
Same issue here with same version as OP
Just use the TreeData prop in the Tree component instead of children.

But I am getting this warning when doing controlled version:
` <Tree
showIcon={false}
showLine={false}
switcherIcon={<Folder/>}
checkable
onExpand={this.onExpand}
expandedKeys={expandedKeys}
autoExpandParent={autoExpandParent}
onCheck={this.onCheck}
checkedKeys={this.state.checkedKeys}
onSelect={this.onSelect}
selectedKeys={this.state.selectedKeys}
filterTreeNode={this.filterTreeNode}
>
{loop(this.props.data)}
</Tree>`
`const loop = data =>
data.map(item => {
if (this.filterKeys && this.filterFn(item.key)) {
this.filterKeys.push(item.key)
}
if (item.children) {
return (
<TreeNode style={{fontFamily: defaultFont.fontFamily, fontWeight: defaultFont.fontWeight, lineHeight: defaultFont.lineHeight}} key={item.key} title={item.title} disableCheckbox={item.key === 'mydisabledkey'}>
{loop(item.children)}
</TreeNode>
)
}
return <TreeNode style={{fontFamily: defaultFont.fontFamily, fontWeight: defaultFont.fontWeight, lineHeight: defaultFont.lineHeight}} key={item.key} title={item.title} />
})`
I'm having the same issue. I would like to customize <TreeNode />.
Found a solution to my problem. If you want to customize the title in Ant Design, you can do it with titleRender.
Hi,
What is the state of this issue?
Is there a plan to revert deprecation for children property?
@Jared-Dahlke
` <Tree showIcon={false} showLine={false} switcherIcon={<Folder/>} checkable onExpand={this.onExpand} expandedKeys={expandedKeys} autoExpandParent={autoExpandParent} onCheck={this.onCheck} checkedKeys={this.state.checkedKeys} onSelect={this.onSelect} selectedKeys={this.state.selectedKeys} filterTreeNode={this.filterTreeNode} >
Does filterTreeNode work in your sample? It gets called in my case but all items (that should be invisible) are still visible.