twobin/react-lazyload

Placeholder memory leak

N00nDay opened this issue · 0 comments

The problem
When I am using placeholder I am getting a Detached HTMLDivElement for each one. This is a significant leak in my case as some plages can have almost 1000+ placeholders.

Steps to reproduce
Add LazyLoad to a long list with the placeholder prop. Before opening the list take a Heap snapshot. Open the list, scroll to the bottom and take another Heap snapshot. Check the difference between the two Heap snapshots and you will see that for every placeholder there is a Detached HTMLDivElement.

Expected behavior
There wouldn't be any detached notes.

Props being used
overflow
resize
once
offset={600}
height={ a.images.length === 0 ? 160 : 460 }
placeholder={ <div>I am Loading...</div> }
scrollContainer={"#feed-container"}