Skip to content

Commit 5940a6b

Browse files
committed
cleaner
1 parent b1b15f3 commit 5940a6b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

web/project-site/src/components/TableOfContents.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ export function TableOfContents() {
2929
};
3030
});
3131

32-
setHeadings(items);
32+
// Update headings state in a microtask to avoid cascading renders
33+
queueMicrotask(() => {
34+
setHeadings(items);
35+
});
3336

3437
const observer = new IntersectionObserver(
3538
(entries) => {

0 commit comments

Comments
 (0)