react-infinite-scroll-component
react-infinite-scroll-component copied to clipboard
added passive listener indication to event handlers, to resolve perfo…
Added passive event listener indication so browsers supporting this feature will run faster and smoother. This addresses these types of warnings seen in Dev Tools (Lighthouse):
[Violation] Added non-passive event listener to a scroll-blocking 'touchstart' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952
Using this extra parameter requires feature detection. Instead of adding a third-party feature detection library, embedded feature detection code in a new util module.
Based on:
- https://web.dev/uses-passive-event-listeners/
- https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md