Skip to content

Releases: SMAKSS/react-scroll-direction

Release Notes for @smakss/react-scroll-direction v4.1.0

05 Apr 19:14
3f57b75
Compare
Choose a tag to compare

We are excited to announce the release of @smakss/react-scroll-direction version 4.1.0. This version brings several improvements and bug fixes that enhance the functionality and usability of our React scroll direction detection hook.

What's New

  • Improvements:

    • Enhanced the scroll position detection accuracy, especially near page boundaries.
    • Updated documentation with more examples and use cases to help developers integrate the hook into their projects more easily.
  • Bug Fixes:

    • Fixed an issue where the scroll direction incorrectly reported as "down" when scrolling the page.

Acknowledgments

A big thank you to @astralarya, @KubaZachacz and the community for their continuous support and feedback, which have been invaluable in making this release possible.

What's Changed

Full Changelog: v4.0.4...v4.1.0

v4.0.4-beta.0

13 Feb 07:07
Compare
Choose a tag to compare

Upgrade dependencies to their latest stable version

13 Feb 07:31
Compare
Choose a tag to compare
v4.0.4

chore(version): upgrade to stable version 4.0.4

Include types path in package.json

31 Dec 21:08
6d9c7ff
Compare
Choose a tag to compare
v4.0.3

chore(core): add types path

Include source map

31 Dec 21:01
db98d87
Compare
Choose a tag to compare
v4.0.2

chore(core): include sourcemap into distribution

Fix package config and distribution

31 Dec 20:49
efb3991
Compare
Choose a tag to compare
v4.0.1

chore(core): fix package rollup config and distribution

Remove commonjs support

31 Dec 20:16
b82d2bb
Compare
Choose a tag to compare
v4.0.0-beta.1

chore(core): remove commonjs support

Add scroll position

31 Dec 19:53
985e7f7
Compare
Choose a tag to compare
v4.0.0-beta.0

feat(scroll-position): add scroll position to the hook return object

Release Notes - Version 4.0.0

31 Dec 20:26
286f4b1
Compare
Choose a tag to compare

Highlights of Version 4.0.0

We are excited to announce the release of version 4.0.0 of the @smakss/react-scroll-direction hook. This major update brings significant enhancements to the hook, introducing the ability to detect not only the scroll direction but also the precise scroll position within the viewport. This feature is essential for developers looking to create more dynamic and responsive UI interactions in their React applications.

New Features

  • Scroll Position Detection: Alongside detecting the scroll direction (up, down, left, right, still), the hook now provides the exact scroll position from the top, bottom, left, and right edges of the viewport. This addition opens up a new realm of possibilities for scroll-based animations and interactions in your application.
  • Enhanced TypeScript Support: Improved type definitions for better integration with TypeScript projects.
  • Extended Compatibility: Ensures seamless integration with popular frameworks and libraries such as Remix, Next.js, and Gatsby.

Updated API

  • The hook now returns an object containing two properties: scrollDir and scrollPosition. scrollDir gives the direction of the scroll, while scrollPosition provides an object with top, bottom, left, and right properties, indicating the scroll distance from respective edges of the viewport.

Breaking Changes

  • Starting from this version, CommonJS support has been discontinued. The package now only supports ES Module imports. This change is part of our effort to streamline the package and embrace modern JavaScript standards.
  • Please note that the return type of the hook has been modified to accommodate the new feature. Ensure to update your implementation to work with the new return type structure.

How to Upgrade

To upgrade to the latest version, run:

npm install @smakss/react-scroll-direction@4.0.0
# or
yarn add @smakss/react-scroll-direction@4.0.0

Example Usage

import useDetectScroll from '@smakss/react-scroll-direction';

function Component() {
  const { scrollDir, scrollPosition } = useDetectScroll();

  // Use scrollDir and scrollPosition as needed
}

Acknowledgements

Special thanks to our contributors and users for their feedback and suggestions that have shaped this release. Your continued support and engagement are invaluable to the growth of this project.

Stay Connected

For more updates, follow us on GitHub and stay tuned for more exciting features!

Upgrade deps

31 Dec 19:29
b91b8fc
Compare
Choose a tag to compare
v3.1.5-beta.0

chore(deps): upgrade deps