Closed matiaspompilio closed 9 months ago
The codebase has been updated to include a new useScroll
hook within the @nanlabs/react-hooks
library. This hook, aimed at enhancing scrolling capabilities, is now available for use in React components. An Example
component demonstrates the hook's functionality by enabling horizontal scrolling for a series of boxes in a container, with buttons to scroll left and right.
File Path | Change Summary |
---|---|
.../useScroll.stories.tsx |
Added Example component using useScroll for scrollable boxes with left/right buttons. |
.../react-hooks/index.ts .../use-scroll/index.ts |
Exported new use-scroll hook and created file to export the useScroll hook. |
.../use-scroll/useScroll.ts |
Introduced useScroll hook with elementRef parameter and scroll function for smooth scrolling. |
🐇 In the code, there's a playful hop, A
useScroll
hook lands with a gentle plop. Boxes glide left and right at a command, Crafted by paws in a digital land. 🌟 🐇
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
What's this PR do?
This PR adds the use-scroll hook which, given a reference to an element, can scroll the element when it is in overflow.
@ulises-jeremias @rpmolina
Summary by CodeRabbit
useScroll
hook for smooth scrolling functionality in React components.Example
component showcasing the use of theuseScroll
hook with interactive elements.