🖇️ use-merge-refs
React Hook that merges two or more refs into a single one.
Installation
npm install use-merge-refs
Demo
Checkout the demo page to see useMergeRefs in action
Usage
import useMergeRefs from 'use-merge-refs';
function Example() {
const catRef = React.useRef();
const dogRef = React.useRef();
const refs = useMergeRefs(catRef, dogRef);
return <div ref={refs} />;
}
License
MIT License