@@ -40,14 +40,12 @@ export default class InfiniteScroll extends Component<Props, State> {
4040 pullToRefreshThresholdBreached : false ,
4141 } ;
4242
43- this . onScrollListener = this . onScrollListener . bind ( this ) ;
4443 this . throttledOnScrollListener = throttle ( 150 , this . onScrollListener ) . bind (
4544 this
4645 ) ;
4746 this . onStart = this . onStart . bind ( this ) ;
4847 this . onMove = this . onMove . bind ( this ) ;
4948 this . onEnd = this . onEnd . bind ( this ) ;
50- this . getScrollableTarget = this . getScrollableTarget . bind ( this ) ;
5149 }
5250
5351 private throttledOnScrollListener : ( e : MouseEvent ) => void ;
@@ -134,7 +132,7 @@ export default class InfiniteScroll extends Component<Props, State> {
134132 }
135133 }
136134
137- componentWillReceiveProps ( props : Props ) {
135+ UNSAFE_componentWillReceiveProps ( props : Props ) {
138136 // do nothing when dataLength and key are unchanged
139137 if (
140138 this . props . key === props . key &&
@@ -150,7 +148,7 @@ export default class InfiniteScroll extends Component<Props, State> {
150148 } ) ;
151149 }
152150
153- getScrollableTarget ( ) {
151+ getScrollableTarget = ( ) => {
154152 if ( this . props . scrollableTarget instanceof HTMLElement )
155153 return this . props . scrollableTarget ;
156154 if ( typeof this . props . scrollableTarget === 'string' ) {
@@ -163,7 +161,7 @@ export default class InfiniteScroll extends Component<Props, State> {
163161 ` ) ;
164162 }
165163 return null ;
166- }
164+ } ;
167165
168166 onStart : EventListener = ( evt : Event ) => {
169167 if ( this . lastScrollTop ) return ;
@@ -257,7 +255,7 @@ export default class InfiniteScroll extends Component<Props, State> {
257255 ) ;
258256 }
259257
260- onScrollListener ( event : MouseEvent ) {
258+ onScrollListener = ( event : MouseEvent ) => {
261259 if ( typeof this . props . onScroll === 'function' ) {
262260 // Execute this callback in next tick so that it does not affect the
263261 // functionality of the library.
@@ -285,7 +283,7 @@ export default class InfiniteScroll extends Component<Props, State> {
285283 }
286284
287285 this . lastScrollTop = target . scrollTop ;
288- }
286+ } ;
289287
290288 render ( ) {
291289 const style = {
0 commit comments