diff --git a/packages/react/src/components/TreeView/TreeNode.js b/packages/react/src/components/TreeView/TreeNode.js index bd5d82aec208..2da53fe1b4fc 100644 --- a/packages/react/src/components/TreeView/TreeNode.js +++ b/packages/react/src/components/TreeView/TreeNode.js @@ -59,7 +59,8 @@ export default function TreeNode({ [`${prefix}--tree-parent-node`]: children, }); const toggleClasses = classNames(`${prefix}--tree-parent-node__toggle-icon`, { - [`${prefix}--tree-parent-node__toggle-icon--expanded`]: expanded, + [`${prefix}--tree-parent-node__toggle-icon--expanded`]: + isExpanded === undefined ? expanded : isExpanded, }); function handleToggleClick(event) { if (onToggle) { @@ -194,7 +195,9 @@ export default function TreeNode({ ); } return ( -