Aljullu / react-lazy-load-image-component

React Component to lazy load images and components using a HOC to track window scroll position.
https://www.npmjs.com/package/react-lazy-load-image-component
MIT License
1.46k stars 110 forks source link

fix(intersection obs): handled edge case where component not visible #115

Closed crisboarna closed 2 years ago

crisboarna commented 2 years ago

Fixes #114

Description Adds sanity check similar to what componentDidMount does at line 42 in src/components/PlaceholderWithoutTracking.jsx to avoid edge case which results in

Uncaught TypeError: IntersectionObserver.unobserve: Argument 1 is not an object.

to occur.

@Aljullu

Aljullu commented 2 years ago

This has been released as part of 1.5.6. Please ping me if you find any issues.