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

1.0.1 • Public • Published

assign-ref

Build status Test coverage NPM version NPM Downloads Prettier Conventional Commits

assign ref for React ref

Installation

npm install assign-ref
# or use yarn
yarn add assign-ref

Usage

import assignRef from 'assign-ref'
const aref = React.createRef()
const bref = React.createRef()

<Button ref={ref => {
    assignRef(aref, ref)
    assignRef(bref, ref)
}}></Button>

Contributing

  • Fork it!
  • Create your new branch:
    git checkout -b feature-new or git checkout -b fix-which-bug
  • Start your magic work now
  • Make sure npm test passes
  • Commit your changes:
    git commit -am 'feat: some description (close #123)' or git commit -am 'fix: some description (fix #123)'
  • Push to the branch: git push
  • Submit a pull request :)

Authors

This library is written and maintained by imcuttle, moyuyc95@gmail.com.

License

MIT - imcuttle 🐟

Package Sidebar

Install

npm i assign-ref

Weekly Downloads

6

Version

1.0.1

License

MIT

Unpacked Size

7.11 kB

Total Files

10

Last publish

Collaborators

  • moyuyc