Skip to content

fix: respect threshold before trigger once cleanup#762

Merged
thebuilder merged 2 commits into
mainfrom
feat/003-threshold-aware-trigger-once
Jul 14, 2026
Merged

fix: respect threshold before trigger once cleanup#762
thebuilder merged 2 commits into
mainfrom
feat/003-threshold-aware-trigger-once

Conversation

@thebuilder

Copy link
Copy Markdown
Owner

Summary

  • use the threshold-aware inView result before cleaning up a triggerOnce observer
  • keep observing when the browser reports an intersection below the configured threshold
  • add regression coverage for a below-threshold entry followed by an at-threshold entry

Fixes #756.

Verification

  • corepack pnpm exec vitest run src/__tests__/useInView.test.tsx
  • corepack pnpm exec vitest run
  • corepack pnpm exec tsc --noEmit
  • corepack pnpm exec biome check src/useInView.tsx src/__tests__/useInView.test.tsx
  • corepack pnpm build

@bolt-new-by-stackblitz

Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@vercel

vercel Bot commented Jul 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
react-intersection-observer Ready Ready Preview, Comment Jul 14, 2026 11:05am

@pkg-pr-new

pkg-pr-new Bot commented Jul 14, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/react-intersection-observer@762

commit: 560e3fa

@thebuilder
thebuilder marked this pull request as ready for review July 14, 2026 11:05
@thebuilder
thebuilder merged commit 24eed1b into main Jul 14, 2026
9 checks passed
@thebuilder
thebuilder deleted the feat/003-threshold-aware-trigger-once branch July 14, 2026 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make useInView triggerOnce respect the configured threshold

1 participant