Skip to content

Commit 2d010da

Browse files
committed
fix: resolve Svelte 5 state reference warning in Toc component
- Use IIFE to capture selector prop value properly - Fixes: state_referenced_locally warning
1 parent a0323b5 commit 2d010da

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib/components/atoms/Toc.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
elements: { item },
1717
states: { activeHeadingIdxs, headingsTree }
1818
} = createTableOfContents({
19-
selector,
19+
selector: (() => selector)(),
2020
exclude: ['h3'],
2121
activeType: 'highest',
2222
pushStateFn: pushState,

0 commit comments

Comments
 (0)