diff --git a/docs/src/components/block-display.tsx b/docs/src/components/block-display.tsx index 093d48ad..4bd84203 100644 --- a/docs/src/components/block-display.tsx +++ b/docs/src/components/block-display.tsx @@ -11,18 +11,22 @@ import { Show, createMemo } from "solid-js"; const BlockViewer = clientOnly(() => import("./block-viewer"), { lazy: true }); const BlockDisplay = (props: { name: string }) => { - const item = createMemo(() => Index.tailwindcss[props.name]); - const tree = createAsync(() => getCachedFileTree(item().files)); - const highlightedFiles = createAsync(() => - getCachedHighlightedFiles(item().files), - ); + const block = createMemo(() => Index.tailwindcss[props.name]); + const data = createAsync(async () => { + const [tree, highlightedFiles] = await Promise.all([ + getCachedFileTree(block().files), + getCachedHighlightedFiles(block().files), + ]); + + return { tree, highlightedFiles }; + }); return ( - + );