visionken
visionken

Reputation: 85

how to add a icon to Tree.TreeNode

I flow Use in create-react-app to create a react app with antd, but how to add a icon to a Tree.TreeNode?

Upvotes: 1

Views: 3067

Answers (1)

yesmeck
yesmeck

Reputation: 316

Since TreeNode[title] can be any ReactElement (See it's doc https://ant.design/components/tree/#TreeNode-props), so that you can write like this <TreeNode key="theKey" title={<span><Icon type="link" />The title</span>} />

Upvotes: 3

Related Questions