doc-undef-fix
This commit is contained in:
parent
7d334df9cf
commit
c378926995
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user