update packages for view hook

This commit is contained in:
Nate Kelley 2025-03-14 13:25:59 -06:00
parent d898e7ecc0
commit 9fea44cc60
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
3 changed files with 11 additions and 3 deletions

7
web/package-lock.json generated
View File

@ -45,6 +45,7 @@
"email-validator": "^2.0.4",
"font-color-contrast": "^11.1.0",
"framer-motion": "^12.5.0",
"intersection-observer": "^0.12.2",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"js-cookie": "^3.0.5",
@ -12939,6 +12940,12 @@
"node": ">= 0.4"
}
},
"node_modules/intersection-observer": {
"version": "0.12.2",
"resolved": "https://registry.npmjs.org/intersection-observer/-/intersection-observer-0.12.2.tgz",
"integrity": "sha512-7m1vEcPCxXYI8HqnL8CKI6siDyD+eIWSwgB3DZA+ZTogxk9I4CDnj4wilt9x/+/QbHI4YG5YZNmC6458/e9Ktg==",
"license": "Apache-2.0"
},
"node_modules/is-alphabetical": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-2.0.1.tgz",

View File

@ -53,6 +53,7 @@
"email-validator": "^2.0.4",
"font-color-contrast": "^11.1.0",
"framer-motion": "^12.5.0",
"intersection-observer": "^0.12.2",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"js-cookie": "^3.0.5",

View File

@ -1,3 +1,5 @@
'use client';
import 'intersection-observer';
import { useState } from 'react';
import type { BasicTarget } from '../lib/domTarget';
@ -13,7 +15,7 @@ export interface Options {
callback?: CallbackType;
}
function useInViewport(target: BasicTarget | BasicTarget[], options?: Options) {
export function useInViewport(target: BasicTarget | BasicTarget[], options?: Options) {
const { callback, ...option } = options || {};
const [state, setState] = useState<boolean>();
@ -54,5 +56,3 @@ function useInViewport(target: BasicTarget | BasicTarget[], options?: Options) {
return [state, ratio] as const;
}
export default useInViewport;