doc-undef-fix
This commit is contained in:
parent
7d334df9cf
commit
c378926995
|
@ -43,15 +43,13 @@ export const TableOfContents = (props: Props) => {
|
|||
setIsVisible(isDesktop())
|
||||
|
||||
const updateHeadings = () => {
|
||||
if (document) {
|
||||
const parent = document.querySelector(props.parentSelector)
|
||||
const parent = document?.querySelector(props.parentSelector)
|
||||
if (parent) {
|
||||
setHeadings(
|
||||
// eslint-disable-next-line unicorn/prefer-spread
|
||||
Array.from(parent.querySelectorAll<HTMLElement>('h1, h2, h3, h4'))
|
||||
)
|
||||
}
|
||||
}
|
||||
setAreHeadingsLoaded(true)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user