Skip to content

Commit

Permalink
fix(useScroll): can not read properties of null (reading document) (#…
Browse files Browse the repository at this point in the history
…3544)

Co-authored-by: João Paulo Siqueira Lins <joaopslins@gmail.com>
  • Loading branch information
loongzhu and joaopslins committed Nov 13, 2023
1 parent 3d6b9c6 commit e97427f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/core/useScroll/index.ts
Expand Up @@ -251,7 +251,11 @@ export function useScroll(
)

tryOnMounted(() => {
setArrivedState(toValue(element))
const _element = toValue(element)
if (!_element)
return

setArrivedState(_element)
})

useEventListener(
Expand Down

0 comments on commit e97427f

Please sign in to comment.