Skip to content

Commit

Permalink
Skip observing already-hydrated nodes
Browse files Browse the repository at this point in the history
Co-authored-by: Felix Arntz <[email protected]>
  • Loading branch information
westonruter and felixarntz authored Jan 10, 2025
1 parent 387ab6c commit d100ab7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/interactivity/src/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ export const init = async () => {

observedNodeCount = nodes.length;
for ( const node of nodes ) {
if ( hydratedIslands.has( node ) ) {
observedNodeCount--;
continue;
}
intersectionObserver.observe( node );
}
};

0 comments on commit d100ab7

Please sign in to comment.