How to unobserve #504
-
Hi there, I wonder if someone could give me a hand. I created a hook like this: I want to unobserve the referenced element at some point. How would I do that? I found this but I don't know how to use it: Mainly I don't know how to populate the arguments. And finally how do I unobserve the element? Just by calling Sorry, I know it is a total newbie question but I am grateful for all the help I can get, thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You can pass in const { ref, inView, entry } = useInView({
skip: true // or false
}); Don't use |
Beta Was this translation helpful? Give feedback.
You can pass in
skip
in the options to unobserve.Don't use
observe
directly unless you have a good reason not to use the hook. :)