apply-ref

> Apply React refs

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
apply-ref
591.0.03 years ago5 years agoMinified + gzip package size for apply-ref in KB

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)
}} />