Skip to content

Is there a way to add a watcher for options? #512

Description

@SilencerWeb

Is your feature request related to a problem? Please describe.
I'm using useInView hook and passing different options based on window width. The problem, that at first I pass a value but then change it to b and useInView hook is not watching for this change, it's using the options that were passed at the very first time.

Describe the solution you'd like
Would be incredible to watch for options change

Describe alternatives you've considered
Right now as I understand the only way is to call useInView hook 2 times and decide what ref to use like this:

  const [animationVisibilityRef, isInView] = useInView({
    triggerOnce: true,
    threshold: 0.6,
  });

  const [animationVisibilityRefMd, isInViewMd] = useInView({
    triggerOnce: true,
    threshold: 0.2,
  });

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions