interface AutoScrollProps {
children: JSXElement
}
function AutoScroll(props: AutoScrollProps) {
onMount(() => {
if (props.children instanceof HTMLElement) {
if (document.body.contains(props.children)) {
console.log("Element is mounted")
} else {
console.log("Element is not mounted")
}
}
})
return props.children
}
/* ... */
<AutoScroll>
<div />
</AutoScroll>
interface AutoScrollProps {
children: JSXElement
}
function AutoScroll(props: AutoScrollProps) {
onMount(() => {
if (props.children instanceof HTMLElement) {
if (document.body.contains(props.children)) {
console.log("Element is mounted")
} else {
console.log("Element is not mounted")
}
}
})
return props.children
}
/* ... */
<AutoScroll>
<div />
</AutoScroll>