mirror of
https://github.com/webstudio-is/webstudio.git
synced 2026-11-07 20:44:05 +09:00
remove unnecessary optimisation
This commit is contained in:
1 parent
4ce953f51f
commit
cbec58bfce
1 file changed
+17
-13
@@ -128,23 +128,27 @@ export const TreeNode = forwardRef<HTMLDivElement, TreeNodeProps>(
|
||||
<Text size="1">{label}</Text>
|
||||
</Button>
|
||||
</Flex>
|
||||
{isExpandable && (isExpanded || animate) && (
|
||||
{isExpandable && (
|
||||
<CollapsibleContent
|
||||
onAnimationEnd={handleAnimationEnd}
|
||||
ref={collapsibleContentRef}
|
||||
>
|
||||
{instance.children.flatMap((child) =>
|
||||
typeof child === "string"
|
||||
? []
|
||||
: [
|
||||
<TreeNode
|
||||
key={child.id}
|
||||
instance={child}
|
||||
level={level + 1}
|
||||
{...commonProps}
|
||||
/>,
|
||||
]
|
||||
)}
|
||||
{
|
||||
// CollapsibleContent automatically doesn't render children when collapsed.
|
||||
// No need to worry about optimizing this.
|
||||
instance.children.flatMap((child) =>
|
||||
typeof child === "string"
|
||||
? []
|
||||
: [
|
||||
<TreeNode
|
||||
key={child.id}
|
||||
instance={child}
|
||||
level={level + 1}
|
||||
{...commonProps}
|
||||
/>,
|
||||
]
|
||||
)
|
||||
}
|
||||
</CollapsibleContent>
|
||||
)}
|
||||
</Collapsible.Root>
|
||||
|
||||
Reference in new issue
Block a user