diff --git a/src/client/theme-default/builtins/Tree/index.tsx b/src/client/theme-default/builtins/Tree/index.tsx index c2ea2cf95..8195e50b5 100644 --- a/src/client/theme-default/builtins/Tree/index.tsx +++ b/src/client/theme-default/builtins/Tree/index.tsx @@ -32,7 +32,7 @@ function getTreeFromList(nodes: ReactNode, prefix = '') { } case 'li': { - const hasEmptyUl = node.props?.children?.some?.( + const hasEmptyUl = node.props.children?.some?.( (child) => child.type === 'ul' && !child.props.children?.length, ); const title = ([] as ReactNode[]) @@ -93,16 +93,16 @@ const getIcon = (props: TreeNodeProps) => { const renderSwitcherIcon = (props: TreeNodeProps) => { const { isLeaf, expanded } = props; if (isLeaf) { - return ; + return ; } return expanded ? ( - + ) : ( - +