Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Re-register use in view hook on component re-render #2579

Open
samducker opened this issue Mar 20, 2024 · 0 comments
Open

[FEATURE] Re-register use in view hook on component re-render #2579

samducker opened this issue Mar 20, 2024 · 0 comments
Labels
feature New feature or request

Comments

@samducker
Copy link

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

I have a component that returns null if a state variable is true, and then it returns html/css/markup if the variable is false. If the animation has not happened already the intersection observer from useInView will not be re-registered on the state change. How can I change this behaviour and register the useInView hook again perhaps in a useEffect when my component re-renders.

This functionality is not clear from the docs.

Describe the solution you'd like
A clear and concise description of what you want to happen.

I'd like to be able to re-trigger useInView inside a useEffect so I can reregister the intersection observer. This currently does not seem like support behaviour from the docs.

@samducker samducker added the feature New feature or request label Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant