Skip to content

Votech/use-merge-refs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🖇️ use-merge-refs

npm npm bundle size NPM

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

About

React Hook that combines two or more refs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published