There are two variants of ref usage in react:
ref object:
const CustomInput = () => {
const ref = useRef();
return <input ref={ref} />
}
and callback ref:
const CustomInput = () => {
const ref = useRef();
return <input ref={el => { ref.current = el; }} />
}
What is the need to have two ref implementations? Is this some kind of legacy issue or anything else?