question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

First of all, awesome package, pretty useful!

I would like to ask, is there any to use with an array of refs? Or any workaround? I have a dynamic list and I want to know what is the current index which is in the viewport, does make sense?

So some ideas just came up in my mind:

const [arrayOfBoolean, arrayOfRefs] = useIsInViewport()

Thanks

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
danilowozcommented, Mar 17, 2021

No problem at all

1reaction
zeusdeuxcommented, Mar 17, 2021

Just a heads up @danilowoz, in case of no activity on this by 26 June 2021, I’ll go ahead and close it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I use multiple refs for an array of elements with hooks?
You can use an array(or an object) to keep track of all the refs and use a method to ...
Read more >
Storing an array of elements using the useRef hook
Storing an array of elements using the useRef hook ... React refs are useful for when we have to set focus to an...
Read more >
How to create an array of React refs - YouTube
Learn how to target multiple elements using React refs.
Read more >
Creating a collection of refs using React - Casey Yee
To do this, you would need to create a collection of refs. ... Create an array on component instance with useRef. ... Push...
Read more >
Using multiple refs for an array of React Elements - Sandny
useRef returns a mutable ref object whose .current property is initialized to the passed argument ( initialValue ). The returned object will ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found