react useref array of refs 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>
))