Skip to content

Latest commit

 

History

History
22 lines (18 loc) · 404 Bytes

README.md

File metadata and controls

22 lines (18 loc) · 404 Bytes

react-combine-refs

Creates a new ref callback, that updates ref arguments. A ref argument can be a function or an object with a .current property.

import combineRefs from 'react-combine-refs';

function MyComponent(
  props,
  refProp,
) {
  const myCustomRef = useRef(null);
  
  // ...
  
  return (
    <div ref={combineRefs(refProp, myCustomRef)}>
      // ...
    </div>
  );
}