Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

apply-ref

mitchellhamilton33.2kMIT1.0.0TypeScript support: included

Apply React refs

react, ref, resolve

readme

apply-ref

Apply React refs

Install

yarn add apply-ref

Usage

import applyRef, { applyRefs } from 'apply-ref'

let ref1 = val => {/*...*/}
let ref2 = React.createRef()

<div ref={applyRefs(ref1, ref2)} />

// OR

<div ref={(val) => {
  applyRef(ref1, val)
  applyRef(ref2, val)
  someOtherHandler(val)
}} />