twobin / react-lazyload

Lazy load your component, image or anything matters the performance.
MIT License
5.87k stars 488 forks source link

get React error: Unable to find node on an unmounted component. #266

Closed NNSTH closed 4 years ago

NNSTH commented 5 years ago

first of all, thanks a lot for this package- I've used it and got much better performance results on my pages.

now to my issue: After upgrading to React 16 + upgrading of all node modules of my project- I started to get this error on NewRelic which monitors my production site: "Unable to find node on an unmounted component."

Stack trace takes me to this line of code: react-lazyload/lib/index.js line: 169 in fonction "checkVisible":

var node = _reactDom2.default.findDOMNode(component);

Could you please offer a quick fix for this issue? it makes a lot of noise in our production monitoring system.

thanks in advance.

NNSTH commented 4 years ago

186 - I see this is already referenced,

any updates pls?