{"_id":"@bscop/use-forward-ref","_rev":"3-3222124f2323fe42ae9b1e1fcb184a5c","name":"@bscop/use-forward-ref","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@bscop/use-forward-ref","version":"1.0.0","description":"React hook that permits to use the forwarded ref, or a fallback when it's not provided.","main":"package/dist/index.js","module":"package/dist/index.es.js","types":"package/src/index.d.ts","scripts":{"badge:coverage":"npm run test:coverage && codecov","prebuild":"rm -rf ./package/dist","build":"rollup -c rollup.config.js","lint":"eslint 'package/**'","prepare":"husky install","prepublishOnly":"npm run build","release":"standard-version","test":"npm run lint && npm run test:types && npm run test:unit","test:debug":"node --inspect $(npm bin)/jest --watch --no-cache --runInBand","test:types":"tsc --noEmit -p package/src","test:unit":"jest --runInBand --coverage"},"repository":{"type":"git","url":"git+https://github.com/brunoscopelliti/react-forward-ref.git"},"directories":{"src":"package/src"},"keywords":["react","react hook","react forwardRef","conditional ref","react hook ref","react useRef","useForwardRef"],"author":{"name":"Bruno Scopelliti"},"license":"MIT","bugs":{"url":"https://github.com/brunoscopelliti/react-forward-ref/issues"},"homepage":"https://github.com/brunoscopelliti/react-forward-ref#readme","devDependencies":{"@babel/preset-env":"^7.14.4","@babel/preset-react":"^7.13.13","@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@rollup/plugin-babel":"^5.3.0","@rollup/plugin-commonjs":"^19.0.0","@testing-library/react":"^11.2.7","@testing-library/react-hooks":"^7.0.0","@types/jest":"^26.0.23","@types/react":"^17.0.8","babel-jest":"^27.0.1","babel-plugin-transform-es2015-modules-commonjs":"^6.26.2","codecov":"^3.8.2","eslint":"^7.27.0","eslint-config-bruno":"^3.0.0","eslint-plugin-jest":"^24.3.6","eslint-plugin-react":"^7.23.2","eslint-plugin-react-hooks":"^4.2.0","eslint-plugin-testing-library":"^4.6.0","husky":"^6.0.0","jest":"^27.0.1","prop-types":"^15.7.2","rollup":"^2.50.4","standard-version":"^9.3.0","typescript":"^4.3.2"},"peerDependencies":{"react":">=17.0.0","react-dom":">=17.0.0"},"gitHead":"7092f7e1ee06bb0c77ad8521ecabc8b708088043","_id":"@bscop/use-forward-ref@1.0.0","_nodeVersion":"15.9.0","_npmVersion":"7.5.3","dist":{"integrity":"sha512-QCT2ux/1i+Usgyf10I6GUsl2pn+XP5PIuFB/unEuI3wbImKX72sdEH7M29POU74JG8X2w/9ydG9Nbw2M6Kho4Q==","shasum":"afe9e8d1827bfafa9d428e007839b1cdf6d591f6","tarball":"https://registry.npmjs.org/@bscop/use-forward-ref/-/use-forward-ref-1.0.0.tgz","fileCount":9,"unpackedSize":7976,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgs/WnCRA9TVsSAnZWagAANS8QAJ19QRJp8QowW9kO22ko\nJbEF4Amv/AuxXRslCVDflnAYZVEOBtJZef1ewWU/MN+rurmFomJ8QJcUkgft\nr5jJICFeujwh1+39TA1Y84tzvw9QD9zs1e0bFLZr7JKMWyyh7vQ84i/0bTnB\nx7Vm4+/lk3GZ8RRxbzOjecjQA8KMVG/dBsOzclu6vNALl4BTZWde2AXH7r2i\n0J4OLXLAgyJw7yJHwYf1tQHl9vS2cerg7KTIzKwjXk3kobgRSRa326V1wuEj\nc1zArOIKavlTu+dFLlUXUYA7o+uD3dyWcoHI95FJdaKsdxprB9J5aJ2Of+kt\nasrrsNcxSy1tqLiMfsqtyGyYRiKOyRD0qXtWgH+0jXSimEGdNZVB1clTTSTM\nySwTH/hLCIEYIKmPgy2bBmol0QGCpxT63nKO/MdLU2+AWPyJyW/glyXoDyK2\npaibmHlFBUdtI8ZEhIxtu2I4usBX0zJ53TpqfR9WmzOw+eXD8ZGsy+++PN32\ngb+tbpiAJ9Y7IgURxX9vB6IN1a6Zl4elDaLy9i6puEyBvofAmzGOMLRD9Vya\nBFQ7KDNkVzQ2m+X/oWAN7FuhRfkw1ruRvC3w6lv/Z5DGB0OMZr9cRI2CyPgH\n22LPG6bMZWHMO6MaO/rEGRonuX5l/f6b7SSS7S3ewePQUGBGJ2LN8djEjykH\nG8ic\r\n=GW5S\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQChcCE8Qg3+fWAZ9KRGXz4JVd8s9rRr3AY+rznMks9PAwIgboYePNIWq0yAXGF1KDHWhIOZ+9ORI2L+OB+y0jXdx0E="}]},"_npmUser":{"name":"brunoscopelliti","email":"bru.scopelliti@gmail.com"},"maintainers":[{"name":"brunoscopelliti","email":"bru.scopelliti@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-forward-ref_1.0.0_1622406567167_0.035686128432745656"},"_hasShrinkwrap":false},"1.0.1":{"name":"@bscop/use-forward-ref","version":"1.0.1","description":"React hook that permits to use the forwarded ref, or a fallback when it's not provided.","main":"package/dist/index.js","module":"package/dist/index.es.js","types":"package/src/index.d.ts","scripts":{"badge:coverage":"npm run test:coverage && codecov","prebuild":"rm -rf ./package/dist","build":"rollup -c rollup.config.js","lint":"eslint 'package/**'","prepare":"husky install","prepublishOnly":"npm run build","release":"standard-version","test":"npm run lint && npm run test:types && npm run test:unit","test:debug":"node --inspect $(npm bin)/jest --watch --no-cache --runInBand","test:types":"tsc --noEmit -p package/src","test:unit":"jest --runInBand --coverage"},"repository":{"type":"git","url":"git+https://github.com/brunoscopelliti/use-forward-ref.git"},"directories":{"src":"package/src"},"keywords":["react","react hook","react forwardRef","conditional ref","react hook ref","react useRef","useForwardRef"],"author":{"name":"Bruno Scopelliti"},"license":"MIT","bugs":{"url":"https://github.com/brunoscopelliti/use-forward-ref/issues"},"homepage":"https://github.com/brunoscopelliti/use-forward-ref#readme","devDependencies":{"@babel/preset-env":"^7.14.4","@babel/preset-react":"^7.13.13","@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@rollup/plugin-babel":"^5.3.0","@rollup/plugin-commonjs":"^19.0.0","@testing-library/react":"^11.2.7","@testing-library/react-hooks":"^7.0.0","@types/jest":"^26.0.23","@types/react":"^17.0.8","babel-jest":"^27.0.2","babel-plugin-transform-es2015-modules-commonjs":"^6.26.2","codecov":"^3.8.2","eslint":"^7.27.0","eslint-config-bruno":"^3.0.0","eslint-plugin-jest":"^24.3.6","eslint-plugin-react":"^7.24.0","eslint-plugin-react-hooks":"^4.2.0","eslint-plugin-testing-library":"^4.6.0","husky":"^6.0.0","jest":"^27.0.1","prop-types":"^15.7.2","rollup":"^2.50.5","standard-version":"^9.3.0","typescript":"^4.3.2"},"peerDependencies":{"react":">=17.0.0","react-dom":">=17.0.0"},"gitHead":"df92b76be3869c4d6cd8d37d9797587c6f3274bd","_id":"@bscop/use-forward-ref@1.0.1","_nodeVersion":"15.9.0","_npmVersion":"7.5.3","dist":{"integrity":"sha512-oMqvFSVCvttVAfbCOtbzBaVZYCUNcpGA9/YBpN47RNgMPcoUndzXori0JGDkELlCkx6jvttExre9EUPgGdjDdQ==","shasum":"ba9a2406a659da53ea6a4751e92d9986e29b19b7","tarball":"https://registry.npmjs.org/@bscop/use-forward-ref/-/use-forward-ref-1.0.1.tgz","fileCount":9,"unpackedSize":8372,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgs/cwCRA9TVsSAnZWagAAiIcP/0+EFUiBFhI13OCynLkb\nA1ncFbBat83s6L3rTzhkEHuUAMpWW6ITg7hA1MsgCXbnkQ9FKvqGx3ao/dPf\n6DlIRVsdQdov6vqMUKCJANbItBgzDmMFsWm9ABGxRnBhn0jyq1JoBJOWbEci\nX69y+XN990L7F6UnneCaf3T1vj1TIz2VHXBmPaTEdR32fN7AnIY9uc0Kd4hm\niU+bc5elaps5vzmofLKPF9fB5Ydxz5xphnjCWCW2/wUFQXcvz5Xav7RHxjHf\nhiVWn/ZQOyFOWzi5YIdx4+/t17tRL97/CxUxLK3EU/gDIgWoucTxQiu81ZbY\nb6D+jJHi+rEXu8ZBVsbZLP3XPw4TFUOkeRjw7hNZ2+puTVY9cP+SlPf1/CQb\naa4aYIxmTQf/D+8jCnu7lHP35gFoCbsbcq629i+6cHnh7EYG8hI6d7dFo1gh\nqJqIoPPZsavGEn+sMG3CTLaq4Dfv7m7npKhBhtiU8x5Ewu5VMk1rL4vu65FL\nDFoR3PKJTdbxrYK8yL8q9+/DfrxWIW6SrS+xpU4kPXD0fJAsJzvvSOOEJOd3\ni6s+cGs75K3oUuOHLElt8e602d09kgmDaYd4zIH3oSmO9T6R5mQuIWRbpZRf\noCDTgFRju+z2kciiWWxhz77dM56e8zWm7i6k7ZC1lrAqCR/TspW+DSZqDygt\nLGnu\r\n=BFkI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAf03LOSI3Y6TjTX5i9K+de+NTvOBaU4vGK5aHUCd65BAiEAioy/whh9dLuwXKEXCoTsubslPBpwv4L2UpoohYrRFD8="}]},"_npmUser":{"name":"brunoscopelliti","email":"bru.scopelliti@gmail.com"},"maintainers":[{"name":"brunoscopelliti","email":"bru.scopelliti@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-forward-ref_1.0.1_1622406959765_0.9734297503187594"},"_hasShrinkwrap":false},"1.0.2":{"name":"@bscop/use-forward-ref","version":"1.0.2","description":"React hook that permits to use the forwarded ref, or a fallback when it's not provided.","main":"package/dist/index.js","module":"package/dist/index.es.js","types":"package/src/index.d.ts","scripts":{"badge:coverage":"npm run test:coverage && codecov","prebuild":"rm -rf ./package/dist","build":"rollup -c rollup.config.js","lint":"eslint 'package/**'","prepare":"husky install","prepublishOnly":"npm run build","release":"standard-version","test":"npm run lint && npm run test:types && npm run test:unit","test:debug":"node --inspect $(npm bin)/jest --watch --no-cache --runInBand","test:types":"tsc --noEmit -p package/src","test:unit":"jest --runInBand --coverage"},"repository":{"type":"git","url":"git+https://github.com/brunoscopelliti/use-forward-ref.git"},"directories":{"src":"package/src"},"keywords":["react","react hook","react forwardRef","conditional ref","react hook ref","react useRef","useForwardRef"],"author":{"name":"Bruno Scopelliti"},"license":"MIT","bugs":{"url":"https://github.com/brunoscopelliti/use-forward-ref/issues"},"homepage":"https://github.com/brunoscopelliti/use-forward-ref#readme","devDependencies":{"@babel/preset-env":"^7.14.4","@babel/preset-react":"^7.13.13","@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@rollup/plugin-babel":"^5.3.0","@rollup/plugin-commonjs":"^19.0.0","@testing-library/react":"^11.2.7","@testing-library/react-hooks":"^7.0.0","@types/jest":"^26.0.23","@types/react":"^17.0.8","babel-jest":"^27.0.2","babel-plugin-transform-es2015-modules-commonjs":"^6.26.2","codecov":"^3.8.2","eslint":"^7.27.0","eslint-config-bruno":"^3.0.0","eslint-plugin-jest":"^24.3.6","eslint-plugin-react":"^7.24.0","eslint-plugin-react-hooks":"^4.2.0","eslint-plugin-testing-library":"^4.6.0","husky":"^6.0.0","jest":"^27.0.3","prop-types":"^15.7.2","rollup":"^2.50.5","standard-version":"^9.3.0","typescript":"^4.3.2"},"peerDependencies":{"react":">=17.0.0","react-dom":">=17.0.0"},"gitHead":"c6aa5f379652d11b3b6882e0266dd9d055e278a8","_id":"@bscop/use-forward-ref@1.0.2","_nodeVersion":"15.9.0","_npmVersion":"7.5.3","dist":{"integrity":"sha512-K6xOmmFR88Aem0LIjghCpVwqjdIGwGavNa50ITnv3wpgrhkQXHexvdUX3g9270wUVjH/DgpKMEpTs/J9vYwH+w==","shasum":"31263f15316fd80a1a53203e2123a195d4cc9476","tarball":"https://registry.npmjs.org/@bscop/use-forward-ref/-/use-forward-ref-1.0.2.tgz","fileCount":9,"unpackedSize":8677,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgtpl6CRA9TVsSAnZWagAA5eQP+QEasfzIZ/SFSN/91O/u\n4wsW2E1tB9Ot0HJKBhOgJkQsjo4QCO2Lz1F5r5sT4BSltXu71vwA8vYJjb41\nMeBXpoDbUCGejlP7sDdncf0xWtl1QH2aqyU2LnypiMPFEsByo30Xcg4xPPb1\n+/cRfvQOJr0j/SmTtUJtNSQ4JNhSATLbtWqpV8lP+RnumAleLD+M0LbjostU\n5x7uMfU3rNLWs0mcb93tCQtUP6zL3d5gMQIFzeaBVKLemMa8afsIX8Z01dIF\nPkMFJJpeHK6znygtrUVmP8KgTg7jplAo4lWOY1fwMYU/WqCMkBbglak37UPe\nGCuJfDjTAKBIkzofTBlMBAdT7tBVORrPy3oT0W9Vxc3fVWNHAEp9Bf0I+Ycp\nbTX5vPIA2k9Xg4JXV0dLcKJjcJE9+ktyrlcNLLk3RGZ7tjbVFdcQn2wmZkc1\nhljIbAFd/8HK31K+9xIWyLdnf1sUOIRcGlYUqHvF0zIJOxMKURdTTAnfNVx6\naAR1ytDd7xnFYmk5dGYkp41mHFnVAQu/JC0WpmBO9LJu3aFTlbDCNHFvV+nx\n0MbTwfUhYVkoa50FzYSmUOEaK9scE5YgtfjtB2DfjYafHXJwKyNrs1bQHP4V\nNI52yQANXU2ALTccG2Dudjo7qS6FapDkRVQkJ9ti86km2Z3godzuGT9/2iqX\nRk6b\r\n=+FXc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCtDH0qgeeQZrQxd8VCqc6ohYqtL4fNH5JfLJuhmPQ59QIhAKDwwFmkIrQxcjWn59Hoi1Gf1R7/Fuf8+n9wEIcWaKlF"}]},"_npmUser":{"name":"brunoscopelliti","email":"bru.scopelliti@gmail.com"},"maintainers":[{"name":"brunoscopelliti","email":"bru.scopelliti@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-forward-ref_1.0.2_1622579578256_0.6865770557015127"},"_hasShrinkwrap":false}},"time":{"created":"2021-05-30T20:29:26.842Z","1.0.0":"2021-05-30T20:29:27.301Z","modified":"2022-04-04T20:50:34.386Z","1.0.1":"2021-05-30T20:35:59.892Z","1.0.2":"2021-06-01T20:32:58.404Z"},"maintainers":[{"name":"brunoscopelliti","email":"bru.scopelliti@gmail.com"}],"description":"React hook that permits to use the forwarded ref, or a fallback when it's not provided.","homepage":"https://github.com/brunoscopelliti/use-forward-ref#readme","keywords":["react","react hook","react forwardRef","conditional ref","react hook ref","react useRef","useForwardRef"],"repository":{"type":"git","url":"git+https://github.com/brunoscopelliti/use-forward-ref.git"},"author":{"name":"Bruno Scopelliti"},"bugs":{"url":"https://github.com/brunoscopelliti/use-forward-ref/issues"},"license":"MIT","readme":"# use-forward-ref\n\n[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/brunoscopelliti/use-forward-ref/blob/main/LICENSE)\n[![npm version](https://img.shields.io/npm/v/@bscop/use-forward-ref.svg?style=flat)](https://www.npmjs.com/package/@bscop/use-forward-ref)\n[![CircleCI Status](https://circleci.com/gh/brunoscopelliti/use-forward-ref.svg?style=shield&circle-token=:circle-token)](https://circleci.com/gh/brunoscopelliti/use-forward-ref)\n[![Coverage](https://img.shields.io/codecov/c/github/brunoscopelliti/use-forward-ref)](https://app.codecov.io/gh/brunoscopelliti/use-forward-ref/)\n\nReact hook that permits to use the forwarded ref, or a fallback when it's not provided.\n\n## Install\n\n```\nnpm i @bscop/use-forward-ref\n```\n\n## Usage\n\n```js\nimport React, { useRef } from \"react\";\nimport useForwardRef from \"@bscop/use-forward-ref\";\n\nconst Demo = React.forwardRef(\n  (props, maybeRef) => {\n    /**\n     * maybeRef can be a ref, or nothing\n     * depending by how the component is used.\n     * ref is always a ref, equal to maybeRef\n     * only when it is a ref.\n     */\n    const ref = useForwardRef(maybeRef);\n\n    return (\n      <div ref={ref}>\n        Demo!\n      </div>\n    );\n  }\n);\n```\n\n## Contribute\n\nRead the [guidelines](./CONTRIBUTING.md).\n\n### Run tests\n\n```\nnpm test\n```\n\n### Coverage\n\nCoverage reports are hosted on [codecov](https://codecov.io/).\n\n```\nnpm run badge:coverage -- --token=<guid>\n```\n\n---\n\nBruno Scopelliti\\\nwww.brunoscopelliti.com\n","readmeFilename":"README.md"}