react-infinite-scroll-component icon indicating copy to clipboard operation
react-infinite-scroll-component copied to clipboard

added passive listener indication to event handlers, to resolve perfo…

Open oranoran opened this issue 4 years ago • 0 comments

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

oranoran avatar Aug 05 '21 14:08 oranoran