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.44k stars 109 forks source link

Re-Render causes effect to replay #68

Closed popmatik closed 4 years ago

popmatik commented 4 years ago

Hi there,

I've noticed when the state is updated it causes a re-render of all child elements. If that is a LazyLoad image with an effect of opacity on it the CSS transition is re-triggered.

Is there any way to prevent this?

Thanks!

popmatik commented 4 years ago

I figured this one out with a shouldComponentUpdate call on the parent component. Thanks.