Panel With Visibility Report on Scrolling
You can render a list of item inside this React component and have it reported item's visibility when scrolling
Installation
Via NPM respository:
npm install react-scroll-panel
Usage
;; /** * This method will be called when users the panel scroll up/down * @param * @param * [{ * node: HTMLElement node, * index: order of element in list * }] */ { } { const items = ; Array; return <Panel className="panel" onScroll=thisonScroll onRef= { thisdiv = input; }>items</Panel> ; } ;
Subcribe onScroll event on Panel component, every users scroll up/down, onScroll method will be called with the list of visible HTMLElement nodes passed in parameters.