Replies: 1 comment
-
I would just use |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary
So, I have a fixed nav on the page (80px in height), but I also need to check whether a subsequent dom element is currently in view.
The problem
The
useInView()
function works great, however, it's triggering too early (80px too early) as technically the element is in on the page but because of the fixed element it's actually not yet in view.The question/solution?
Is there a way to account for fixed elements when using the
useInView()
function?My code (React, NextJs)
`const { additionalClass = '', children } = props
Beta Was this translation helpful? Give feedback.
All reactions