use-merge-refs
v1.0.4
Published
React Hook that combines two or more refs
Downloads
22
Maintainers
Readme
🖇️ 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