apply-ref
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i apply-ref

Weekly Downloads

19,546

Version

1.0.0

License

MIT

Unpacked Size

4.81 kB

Total Files

9

Last publish

Collaborators

  • emmatown