Combines multiple refs into a single callback ref.
The type of the element.
The refs to combine.
A callback ref that updates all provided refs.
Useful when you need to forward a ref to a child component but also need to access the DOM node locally. It handles both callback refs and object refs.
const ref1 = useRef(null);const ref2 = useRef(null);const combinedRef = useCombinedRefs(ref1, ref2);return <div ref={combinedRef} />; Copy
const ref1 = useRef(null);const ref2 = useRef(null);const combinedRef = useCombinedRefs(ref1, ref2);return <div ref={combinedRef} />;
Combines multiple refs into a single callback ref.