mirror of
https://github.com/ZetaKebab/quartz.git
synced 2025-06-22 00:34:37 +00:00
perf: eagerly compute explorer nodes to avoid re-render in memoized value
This commit is contained in:
@ -224,15 +224,10 @@ export function ExplorerNode({ node, opts, fullPath, fileData }: ExplorerNodePro
|
||||
class="content"
|
||||
data-folderul={folderPath}
|
||||
>
|
||||
{node.children.map((childNode, i) => (
|
||||
<ExplorerNode
|
||||
node={childNode}
|
||||
key={i}
|
||||
opts={opts}
|
||||
fullPath={folderPath}
|
||||
fileData={fileData}
|
||||
/>
|
||||
))}
|
||||
{node.children.map((childNode) =>
|
||||
// eagerly render children so we can memoize properly
|
||||
ExplorerNode({ node: childNode, opts, fileData, fullPath: folderPath }),
|
||||
)}
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
|
Reference in New Issue
Block a user