DEV Community

Discussion on: React refs in a loop

Collapse
 
nicm42 profile image
Nic

For the first question, I can't remember why I needed to do it that way.

When it comes to refer to them, you have to use .current. So myRefs[i] doesn't work, but myRefs.current[i] will.