Enhanced TypeScript Integration & Streamlined Hook Usage
π Features and Improvements:
-
Simplified Hook Usage: With the addition of default assignments to props, you can now seamlessly employ
useDetectScroll
without passing an empty object for default options.const scrollDir = useDetectScroll();
-
SSR Compatibility: Addressing the issue where the
useDetectScroll
hook utilized the window object to establish the initial value oflastScroll
, causing aReferenceError
during server-side rendering in platforms like Next.js, we've introduced a fix. The solution initializeslastScroll
to0
and repositions the window object reference within theuseEffect
hook, ensuring it's solely accessed on the client-side, thus sidestepping the error. -
Upgraded Dependencies: In our commitment to maintaining current, we've updated our package dependencies.
-
π Pull Request Template: A PR template has been embedded to streamline and standardize the pull request process, ensuring consistent quality and clarity.
-
PR Checks CI: Every pull request will now undergo a rigorous CI check aimed at maintaining code quality and flagging any errors, ensuring that the codebase remains robust and efficient.
-
Pre-commit Hooks: To further our drive towards excellence, we've embedded pre-commit hooks. These are tailored to check types, formatting, and commit messages, ensuring the highest standards are maintained even before code hits the repository.
Thank you for your unwavering support and contributions. They're invaluable in our journey of refining and improving this package. Should you have queries or feedback regarding this release, please reach out; we're all ears.
Also, a special thanks to @drichar for their contribution to this release.