From 7cd73d75698bb79add5bd42ebbdc080abdfc90d0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 18 Jun 2024 12:32:20 +0200 Subject: [PATCH] Update dependency usehooks-ts to v3 (#885) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: lukasIO --- .changeset/small-sheep-check.md | 5 +++++ packages/react/package.json | 2 +- .../react/src/components/participant/VideoTrack.tsx | 4 ++-- pnpm-lock.yaml | 10 +++++----- 4 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 .changeset/small-sheep-check.md diff --git a/.changeset/small-sheep-check.md b/.changeset/small-sheep-check.md new file mode 100644 index 000000000..f4fa8f06b --- /dev/null +++ b/.changeset/small-sheep-check.md @@ -0,0 +1,5 @@ +--- +"@livekit/components-react": patch +--- + +Update usehooks-ts to v3 diff --git a/packages/react/package.json b/packages/react/package.json index 62d24b8af..162bf1832 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -50,7 +50,7 @@ "@livekit/components-core": "workspace:*", "@react-hook/latest": "1.0.3", "clsx": "2.1.1", - "usehooks-ts": "2.16.0" + "usehooks-ts": "3.1.0" }, "peerDependencies": { "@livekit/protocol": "^1.16.0", diff --git a/packages/react/src/components/participant/VideoTrack.tsx b/packages/react/src/components/participant/VideoTrack.tsx index 16d23c6f9..5eee8336d 100644 --- a/packages/react/src/components/participant/VideoTrack.tsx +++ b/packages/react/src/components/participant/VideoTrack.tsx @@ -42,9 +42,9 @@ export const VideoTrack = /* @__PURE__ */ React.forwardRef(null); React.useImperativeHandle(ref, () => mediaEl.current as HTMLVideoElement); - const intersectionEntry = useHooks.useIntersectionObserver(mediaEl, {}); + const intersectionEntry = useHooks.useIntersectionObserver({ root: mediaEl.current }); - const debouncedIntersectionEntry = useHooks.useDebounce(intersectionEntry, 3000); + const [debouncedIntersectionEntry] = useHooks.useDebounceValue(intersectionEntry, 3000); React.useEffect(() => { if ( diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 60421d3d1..8043ebe6a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -216,8 +216,8 @@ importers: specifier: ^2.6.2 version: 2.6.2 usehooks-ts: - specifier: 2.16.0 - version: 2.16.0(react@18.3.1) + specifier: 3.1.0 + version: 3.1.0(react@18.3.1) devDependencies: '@livekit/protocol': specifier: ^1.16.0 @@ -7472,8 +7472,8 @@ packages: peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 - usehooks-ts@2.16.0: - resolution: {integrity: sha512-bez95WqYujxp6hFdM/CpRDiVPirZPxlMzOH2QB8yopoKQMXpscyZoxOjpEdaxvV+CAWUDSM62cWnqHE0E/MZ7w==} + usehooks-ts@3.1.0: + resolution: {integrity: sha512-bBIa7yUyPhE1BCc0GmR96VU/15l/9gP1Ch5mYdLcFBaFGQsdmXkvjV0TtOqW1yUd6VjIwDunm+flSciCQXujiw==} engines: {node: '>=16.15.0'} peerDependencies: react: ^16.8.0 || ^17 || ^18 @@ -16421,7 +16421,7 @@ snapshots: dependencies: react: 18.3.1 - usehooks-ts@2.16.0(react@18.3.1): + usehooks-ts@3.1.0(react@18.3.1): dependencies: lodash.debounce: 4.0.8 react: 18.3.1