use-merge-refs
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

🖇️ 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

Package Sidebar

Install

npm i use-merge-refs

Weekly Downloads

6

Version

1.0.4

License

MIT

Unpacked Size

6.52 kB

Total Files

6

Last publish

Collaborators

  • votech