doc-undef-fix

This commit is contained in:
Untone 2024-10-06 10:21:26 +03:00
parent 7d334df9cf
commit c378926995

View File

@ -43,14 +43,12 @@ export const TableOfContents = (props: Props) => {
setIsVisible(isDesktop()) setIsVisible(isDesktop())
const updateHeadings = () => { const updateHeadings = () => {
if (document) { const parent = document?.querySelector(props.parentSelector)
const parent = document.querySelector(props.parentSelector) if (parent) {
if (parent) { setHeadings(
setHeadings( // eslint-disable-next-line unicorn/prefer-spread
// eslint-disable-next-line unicorn/prefer-spread Array.from(parent.querySelectorAll<HTMLElement>('h1, h2, h3, h4'))
Array.from(parent.querySelectorAll<HTMLElement>('h1, h2, h3, h4')) )
)
}
} }
setAreHeadingsLoaded(true) setAreHeadingsLoaded(true)
} }