JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 37979
  • Score
    100M100P100Q154352F
  • License MIT

A React hook for merging multiple refs into one ref

Package Exports

  • @react-hook/merged-ref

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@react-hook/merged-ref) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

bundlephobia MIT license


@react-hook/merged-ref

A React hook for merging multiple refs into one ref

Installation

npm i merged-ref

yarn add merged-ref

Usage

import React from 'react'
import useMergedRef from '@react-hook/merged-ref'

const F = React.forwardRef((props, ref) => {
  const otherRef = React.useRef(null)
  const multiRef = useMergedRef(ref, otherRef)
  return <div ref={multiRef} />
})

LICENSE

MIT