Skip to content

Commit

Permalink
Create tidy-bears-turn.md
Browse files Browse the repository at this point in the history
  • Loading branch information
mcansh committed May 19, 2023
1 parent ba6a81e commit 3fd52d2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/tidy-bears-turn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"remix": patch
"@remix-run/react": patch
---

adds support for viewport prefetching to `<Link>`. this allows you to prefetch a page when it gets into view via an [intersection observer](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver)
1 change: 0 additions & 1 deletion packages/remix-react/components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,6 @@ function usePrefetchBehavior<T extends HTMLAnchorElement>(

if (prefetch === "viewport") {
let callback: IntersectionObserverCallback = (entries) => {
console.log("entries", entries);
entries.forEach((entry) => {
if (entry.isIntersecting) setShouldPrefetch(true);
});
Expand Down

0 comments on commit 3fd52d2

Please sign in to comment.