apply-ref
Version:
> Apply React refs
29 lines (19 loc) • 344 B
Markdown
> Apply React refs
```bash
yarn add apply-ref
```
```jsx
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)
}} />
```