{"_id":"react-use-scroll-position","_rev":"4-cd49603568551380d81372b5bf6ea636","name":"react-use-scroll-position","dist-tags":{"latest":"2.0.0"},"versions":{"1.0.0-alpha.0":{"name":"react-use-scroll-position","version":"1.0.0-alpha.0","description":"A react hook to use scroll position","main":"index.js","scripts":{"build":"tsc","prepare":"npm run build","test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/neo/react-use-scroll-position.git"},"keywords":["scroll","position","react","hook","scroll position","react hook"],"author":{"name":"Wenchen Li","email":"neo.li@jam3.com","url":"https://wenchen.li/"},"license":"MIT","bugs":{"url":"https://github.com/neo/react-use-scroll-position/issues"},"homepage":"https://github.com/neo/react-use-scroll-position#readme","peerDependencies":{"react":">=16.8.0"},"devDependencies":{"@types/react":"^16.7.20","react":"^16.8.0-alpha.1","typescript":"^3.2.4"},"gitHead":"e822cb98bf4e7cd7acf83977fc0ee5916b16570e","_id":"react-use-scroll-position@1.0.0-alpha.0","_npmVersion":"6.4.1","_nodeVersion":"10.1.0","_npmUser":{"name":"neoli","email":"neo.li@jam3.com"},"dist":{"integrity":"sha512-jZmSKRIzrZ2Z9Do+zDem/w9/4zmAvyJi1ZWo+67hUivmbgdIn2JIFUhAj3exUcl5DsZurUlxi+UjQgvEc2C+Mg==","shasum":"bd21f760ba85c845c87d586a9472fd6eda5038a4","tarball":"https://registry.npmjs.org/react-use-scroll-position/-/react-use-scroll-position-1.0.0-alpha.0.tgz","fileCount":7,"unpackedSize":10161,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcQ06YCRA9TVsSAnZWagAAKscP/2Ye3H7ZW/YzVTG9DVgW\nc9KqI2tyFTkQCznsjdtqDJTL+3b//savcK1C5aJp0IXq6WtZ9XKV8w78KMRC\nph46TqsCINvf3iAMH6XMvmQ8NE2SRHl02wUE86NXTerSLRe2sDJiOpPKkAsr\nGIUV4ytKSf+zrCbwrTIdY6tDSzX9YwMpbXl87iLMhf0kPKlHqjWgbEoGUj0N\nEBoAlusZKCfAUmbC7JnWygQ/biDN/Y09kZAdBSXmXVLtHMQRW1R2gcsEq/qJ\nkUgeCn9yPsrVUMb8OzbY3JcyappwwN8L4V5yPlpsxmBBcHbtGP2O1nWV4R8v\nv75VOgIMn7rt+z8bAZ3yJhRHYj9YJpv++O5eG4gJxGUYnTtKm2btDZhBvNMn\n0sHYZsgUNHdGBKAF/We5BS4HYJnepOMR64c4qZJyKuN0OfdplXzDAVnVLMog\niswSxJfT/qyefqmd120NvYBWRz867iqFsurp44dfsQo4mNoD0RVGUl+8ScEO\nf0SB+lahoVFq8dYYofzxJFtbKZysYtpqMRckLRf9l/+9kbDIrcW8XsVqdOkz\n3nXo2SfrEk0QGnDw1rJgjnbS5aZo6SjZES8XzTXCzQFV8b7IIEM/VMnPRtqf\n62nssFOExUta0KUdPGanaRB/hXhciMSLNiLOrNPO8pIh9iGEMfyNpgBkQoXy\n5mbx\r\n=niOo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDkwdPuTVcR3aJD6i7j6ujRZSaOkyTLQ8Lt3GYPj4H0gwIgaxPW3hQMnt4XmWCLU/VkdMgCzFoayyisEJGMaJDGqcU="}]},"maintainers":[{"name":"neoli","email":"neo.li@jam3.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-use-scroll-position_1.0.0-alpha.0_1547914904219_0.9765468189371547"},"_hasShrinkwrap":false},"1.0.0-alpha.1":{"name":"react-use-scroll-position","version":"1.0.0-alpha.1","description":"A react hook to use scroll position","main":"index.js","types":"index.d.ts","scripts":{"build":"tsc","prepare":"npm run build","test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/neo/react-use-scroll-position.git"},"keywords":["scroll","position","react","hook","scroll position","react hook"],"author":{"name":"Wenchen Li","email":"neo.li@jam3.com","url":"https://wenchen.li/"},"license":"MIT","bugs":{"url":"https://github.com/neo/react-use-scroll-position/issues"},"homepage":"https://github.com/neo/react-use-scroll-position#readme","peerDependencies":{"react":">=16.8.0"},"devDependencies":{"@types/react":"^16.7.20","react":"^16.8.0-alpha.1","typescript":"^3.2.4"},"gitHead":"afb85adb6888301e76733c219bedc4a0f2d2b2cc","_id":"react-use-scroll-position@1.0.0-alpha.1","_npmVersion":"6.4.1","_nodeVersion":"10.1.0","_npmUser":{"name":"neoli","email":"neo.li@jam3.com"},"dist":{"integrity":"sha512-OMOM1YxWEouRUZAn7ias8xEYQinCPX6HuF5a48lXPRwygR4uVy9Er2aSuhtwZpaSPmzUitMrvBzJVSroG+Bhrw==","shasum":"a6346923216fda2a2db9c5a7d177de01b9cfaf20","tarball":"https://registry.npmjs.org/react-use-scroll-position/-/react-use-scroll-position-1.0.0-alpha.1.tgz","fileCount":7,"unpackedSize":11076,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcRJ5SCRA9TVsSAnZWagAAK6QQAJu1A0ZineI9IRUGEMFy\nfK+jzVadq2cw94It1itP91CrDXoRgZeHCGZ3/GvHkSPbtbwd5nsEfinxoiyb\nQ1sx/7/dI8f4IFmiBZqbWT9zDkW9vHED0nvqZ1298hfl0wI4pLMiMu/NoWck\nUJjkmUn6wS6SPz16K4qZeHv7VIUX8b40nF2HGan2hYA+LcBubiiwdeG88pGg\nl7POT/aZU+whuS+BBpMfFuFdnvWwd/CgQ5zbszyuYCkeX9lVEdT7EPZ9rUME\nS0iJ2vMYKx2KcxSODP7YvE2h3JMxy/YQSRkPzjz5AygEgoIN/ujybvhWjMqk\niL/F6zFAuVTTfFbi/IxvxPIfP1hnHC21dSS6/tB8Q62rs1HaxA4oAzUSOiHE\nSSSdW9azxYIH9lELArRPYiuBHXYTGj2FdpuE+YtURTPU0U4gZ6Kokt/7Kypi\nl6NbdDxbxpV7edUzpj5vCdtZTy0ZyhmeD67twPtODUXNKqI5RO9L/W/iPufS\nQ1CQUaeQ50yROxtsp03NMiad7wJ7XreRorOiuavqjWnO48BFphmt3XpyhHLw\nXXW2fcOT7WNBbKVYGSeFTWloEbL8vY/37+hnNy4FF1sebWjNUUJ6ac36Zl7I\nf7t67caOZmIkCn95Xh6OFGPy+NN8frV49YSd7F6k7WlDp2EOefmGIhpDK+cP\nHcxW\r\n=Mkoa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDJ+dOkpAzoCpFx9iTEE7VcnSmvpBrX5WjZRw5aXie+uAiBWsq4jqQ6BCQGDDfyrjdPuqM4xC2mlGFYkJW0/q5QBbQ=="}]},"maintainers":[{"name":"neoli","email":"neo.li@jam3.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-use-scroll-position_1.0.0-alpha.1_1548000850236_0.6397680026033157"},"_hasShrinkwrap":false},"1.0.0":{"name":"react-use-scroll-position","version":"1.0.0","description":"A react hook to use scroll position","main":"index.js","types":"index.d.ts","scripts":{"build":"tsc","prepare":"npm run build","test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/neo/react-use-scroll-position.git"},"keywords":["scroll","position","react","hook","scroll position","react hook"],"author":{"name":"Wenchen Li","email":"neo.li@jam3.com","url":"https://wenchen.li/"},"license":"MIT","bugs":{"url":"https://github.com/neo/react-use-scroll-position/issues"},"homepage":"https://github.com/neo/react-use-scroll-position#readme","peerDependencies":{"react":">=16.8.0"},"devDependencies":{"@types/react":"^16.8.2","react":"^16.8.1","typescript":"^3.3.1"},"gitHead":"6650b8eed29d054bd00f295669988e6a767869a2","_id":"react-use-scroll-position@1.0.0","_npmVersion":"6.4.1","_nodeVersion":"10.1.0","_npmUser":{"name":"neoli","email":"neo.li@jam3.com"},"dist":{"integrity":"sha512-nidZCCxYMCM+tKD+zC7qvW8c1ihEKrv31hrF89Ppuh7vPahDBXLgHtlEjmCm/lWc6nquProQ5rJC2iHSRftB1g==","shasum":"6243b053ae0b0a94cf72263932018e1694cbc010","tarball":"https://registry.npmjs.org/react-use-scroll-position/-/react-use-scroll-position-1.0.0.tgz","fileCount":7,"unpackedSize":11059,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcW5r+CRA9TVsSAnZWagAA6B4P/2NMrftmOAjqHWNfQ689\ntJmq7nGyg34H9lQl1Lh6U5ePwQlls1p5sJstYoB2tTWvz/MeoR8wAaepT/lN\nLCXRNNfACYZMbWqePzHvcDKhNV0ZNlsB+yC4UvCpVeaI2N7xqvD3cO14T6Y2\nJbBjrFUpvKk/kD6PAtSDOnhYiDmbMTUrOgInbjiYPE8BcSgpsPEwIjPZ+uTy\nnkCabLrBEjlowx/U/RBXiwb40ZwBIBZA8KXZH3gCFse0KCON98g8EMyFsTIq\nfkI+WkcTjDT2t8Z3ZdVOpNHFYJ7uKUOqgjlJlGHImZ4UJEjfjT14I0J5+SDK\nZ2xk/kG5WPknkLLf73iNFgZdFD3UDzOETR1D0W9Ett+sIlARSFVuqs3z55iJ\nBvvyUUiWJv6SDTsg70EnpkMRC+IActcP3zUAhJEVo8j+pZYMS+fmyzEhmCSS\nwsUF53mkty+KdfkUHd5VoTQ/Z4svuNegjZzjf7eh+vPhslxRL0cW8MwFCA0I\nkaj0jin1ykgJ8h8q+Si+zysljE49xanRe2yJ3Zb4WydaYDV5nVd9GzEQ9G4H\n9QnHeAZhmkf/idI78HLnmkGToM/LXqFkRLeM26XW1HZZeVyKYq9xVjaIihLX\nNYgyl+Ps/Q+zfbDY+Wpm7/54QHfavfA57gScVqlsDxpRrfW37dg4tV1LeQEq\nyNFa\r\n=sFtd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEy9WpTzcsbjXKvkmV3Ry0+al6JgA9uxhJSyUJnqSXJyAiBZXahOOf11QlOANJ7SHui+ARKrjuhyh5id1y0wmGEZDA=="}]},"maintainers":[{"name":"neoli","email":"neo.li@jam3.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-use-scroll-position_1.0.0_1549507325703_0.7377090642614399"},"_hasShrinkwrap":false},"2.0.0":{"name":"react-use-scroll-position","version":"2.0.0","description":"A react hook to use scroll position","main":"index.js","types":"index.d.ts","scripts":{"build":"tsc","prepare":"npm run build","test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/neo/react-use-scroll-position.git"},"keywords":["scroll","position","react","hook","scroll position","react hook"],"author":{"name":"Wenchen Li","email":"neo.li@jam3.com","url":"https://wenchen.li/"},"license":"MIT","bugs":{"url":"https://github.com/neo/react-use-scroll-position/issues"},"homepage":"https://github.com/neo/react-use-scroll-position#readme","peerDependencies":{"react":">=16.8.0"},"devDependencies":{"@types/react":"^16.8.19","react":"^16.8.6","typescript":"^3.5.1"},"gitHead":"1c757c3a6c2a5d9b235305450d0a9f6e71472880","_id":"react-use-scroll-position@2.0.0","_nodeVersion":"12.2.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-nQaWMPElzI8aN1vYTnqy0xV17pEhItgyWUBOtdmMEqsbY1mV3+iZMyTeAJ+oegsQIugYxBU4LnV2NosynN+KKA==","shasum":"c5bb29f751d126ff1c0306c28d7055ce0d4ef034","tarball":"https://registry.npmjs.org/react-use-scroll-position/-/react-use-scroll-position-2.0.0.tgz","fileCount":7,"unpackedSize":11318,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc8rrDCRA9TVsSAnZWagAAXwoQAJV5Q8fyatOC8jT/z9Te\nGZek/27U+wMRPhighRZJ1YB9OUpuDthErjcJJ5mwr9Dt0unUi9lHGOILYAUD\nQ+HXlF1mJ23iNUOUki5D8g5JDBZ5vzP5o3/iOUfwdHfE+JUWnFDrOjjHwG2A\ncKQYJAiFOWMREhjt597/a+/RY4sTl97UBf6CG2NXGL1fYvYjKmuFfmEW+f7U\nWTIJhbA8zbrcEtBLGtAnwDfXzx61wm3ssV3jwJn6rFr97BxftUM3FbCKYyDD\niQC+CkT9xIeKRbcQ+xAY7/enq54Q/qML4uzgD9hxjYKmOpaIG53x9D1XMkDG\nuRxRXMGxBqEIidf57MeJaac+dc9uXDBQGmLAva7phzS0jun4WrhESxt1mGPV\nYHR9F15UTmA4I1XBkCqEPkgrk8yqcTMjLX73uGyv6b1Fbd/NIV0G0xXEGEoP\nMdODQoALx8PmVxvx3VAZgQnhtVWKedkJ9xxrJcqAEMpEOGuXoQeTsPvDCAeK\nu9/OKRG3G+u4XC/iLuC7qRhSmxM0mSiGXF+dAjTYPVPjpvwbxIrs+hbWoYcW\ni7RJF1EoYU+/4sne5oNIKAhCUtXggXh3HzDgujJfjrgtRrp3ZlkFx1BrSzIq\nTj+IamBzfl22Ml8UMT8j0QOlVt8MgQGA8fGY/VttPBTiKNKOBvWin2JwcZaF\nTngx\r\n=TX9j\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC37sKYxY0FnKvuZkA2o20qLe0UigT/d+GtXjV7NXptCAiAIP6OiwJquAK0lCBxVHlGYCY1Rb6H9ojYifAYolvpnjA=="}]},"maintainers":[{"name":"neoli","email":"neo.li@jam3.com"}],"_npmUser":{"name":"neoli","email":"neo.li@jam3.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-use-scroll-position_2.0.0_1559411394578_0.11294454478513405"},"_hasShrinkwrap":false}},"time":{"created":"2019-01-19T16:21:44.218Z","1.0.0-alpha.0":"2019-01-19T16:21:44.332Z","modified":"2022-05-15T07:10:05.973Z","1.0.0-alpha.1":"2019-01-20T16:14:10.344Z","1.0.0":"2019-02-07T02:42:05.786Z","2.0.0":"2019-06-01T17:49:54.708Z"},"maintainers":[{"name":"neoli","email":"neo.li@jam3.com"}],"description":"A react hook to use scroll position","homepage":"https://github.com/neo/react-use-scroll-position#readme","keywords":["scroll","position","react","hook","scroll position","react hook"],"repository":{"type":"git","url":"git+https://github.com/neo/react-use-scroll-position.git"},"author":{"name":"Wenchen Li","email":"neo.li@jam3.com","url":"https://wenchen.li/"},"bugs":{"url":"https://github.com/neo/react-use-scroll-position/issues"},"license":"MIT","readme":"# react-use-scroll-position\n\n[![npm package](https://img.shields.io/npm/v/react-use-scroll-position.svg)](https://www.npmjs.com/package/react-use-scroll-position) ![](https://img.shields.io/npm/types/react-use-scroll-position.svg)\n\nA [react hook](https://reactjs.org/docs/hooks-intro.html) to use scroll position.\n\n## Usage\n\n### In a React functional component:\n\n```tsx\nimport React from 'react';\n// Usually you would just need to import one of the following\nimport { useScrollPosition, useScrollXPosition, useScrollYPosition } from 'react-use-scroll-position';\n\nfunction Example() {\n  const { x, y } = useScrollPosition();\n  const scrollX = useScrollXPosition();\n  const scrollY = useScrollYPosition();\n  return (\n    <>\n      <p>\n        {x} should equal to {scrollX}.\n      </p>\n      <p>\n        {y} should equal to {scrollY}.\n      </p>\n    </>\n  );\n}\n```\n\n### In a custom React hook\n\n```tsx\nimport { useScrollPosition } from 'react-use-scroll-position';\n\nfunction useYourImagination() {\n  const { x, y } = useScrollPosition();\n  return getSomethingAwesomeWith(x, y);\n}\n```\n\n# Implementation details\n\nThe scroll event handler is throttled by `requestAnimationFrame`.\n","readmeFilename":"README.md"}