useRef with array code example
Example: useref array of refs
// https://mattclaffey.medium.com/adding-react-refs-to-an-array-of-items-96e9a12ab40c
const itemEls = useRef(new Array())
{items.map(item => (
<p key={item} ref={(element) => itemEls.current.push(element)}>{item}</p>
))