caseywebdev / react-list

:scroll: A versatile infinite scroll React component.
https://caseywebdev.github.io/react-list
MIT License
1.96k stars 176 forks source link

Fix operation in strict mode #253

Open ska-kialo opened 9 months ago

ska-kialo commented 9 months ago

We were struggling with using ReactList with strict mode in our application.

The problem seems to be that the listeners on the scroll parents are removed but this.scrollParent remains set. This means that on the second mount strict mode does, updateScrollParent will not add the required listeners.

Setting scrollParent to null on unmount resolves this problem.