Javascript – Filtering out a key from a useState is causing the last element of ref object to null
I have a visuals state that contains a list of JSX visuals, and their corresponding references stored in a useRef object. I key into both of these with a ref "counter". Currently in the useEffect, when pressed (a state) is…