@@ -87,7 +87,11 @@ export default class InfiniteScroll extends Component {
8787
8888 componentWillReceiveProps ( props ) {
8989 // do nothing when dataLength and key are unchanged
90- if ( this . props . key === props . key && this . props . dataLength === props . dataLength ) return ;
90+ if (
91+ this . props . key === props . key &&
92+ this . props . dataLength === props . dataLength
93+ )
94+ return ;
9195
9296 this . actionTriggered = false ;
9397 // update state when new data was sent in
@@ -98,8 +102,9 @@ export default class InfiniteScroll extends Component {
98102 }
99103
100104 getScrollableTarget ( ) {
101- if ( this . props . scrollableTarget instanceof HTMLElement ) return this . props . scrollableTarget ;
102- if ( typeof this . props . scrollableTarget === 'string' ) {
105+ if ( this . props . scrollableTarget instanceof HTMLElement )
106+ return this . props . scrollableTarget ;
107+ if ( typeof this . props . scrollableTarget === "string" ) {
103108 return document . getElementById ( this . props . scrollableTarget ) ;
104109 }
105110 if ( this . props . scrollableTarget === null ) {
@@ -119,7 +124,8 @@ export default class InfiniteScroll extends Component {
119124 this . currentY = this . startY ;
120125
121126 this . _infScroll . style . willChange = "transform" ;
122- this . _infScroll . style . transition = `transform 0.2s cubic-bezier(0,0,0.31,1)` ;
127+ this . _infScroll . style . transition =
128+ "transform 0.2s cubic-bezier(0,0,0.31,1)" ;
123129 }
124130
125131 onMove ( evt ) {
@@ -143,7 +149,7 @@ export default class InfiniteScroll extends Component {
143149 this . startY } px, 0px)`;
144150 }
145151
146- onEnd ( evt ) {
152+ onEnd ( ) {
147153 this . startY = 0 ;
148154 this . currentY = 0 ;
149155
@@ -156,9 +162,9 @@ export default class InfiniteScroll extends Component {
156162 requestAnimationFrame ( ( ) => {
157163 // this._infScroll
158164 if ( this . _infScroll ) {
159- this . _infScroll . style . overflow = "auto" ;
160- this . _infScroll . style . transform = "none" ;
161- this . _infScroll . style . willChange = "none" ;
165+ this . _infScroll . style . overflow = "auto" ;
166+ this . _infScroll . style . transform = "none" ;
167+ this . _infScroll . style . willChange = "none" ;
162168 }
163169 } ) ;
164170 }
@@ -178,7 +184,8 @@ export default class InfiniteScroll extends Component {
178184 }
179185
180186 return (
181- target . scrollTop + clientHeight >= threshold . value / 100 * target . scrollHeight
187+ target . scrollTop + clientHeight >=
188+ ( threshold . value / 100 ) * target . scrollHeight
182189 ) ;
183190 }
184191
@@ -193,8 +200,8 @@ export default class InfiniteScroll extends Component {
193200 this . props . height || this . _scrollableNode
194201 ? event . target
195202 : document . documentElement . scrollTop
196- ? document . documentElement
197- : document . body ;
203+ ? document . documentElement
204+ : document . body ;
198205
199206 // return immediately if the action has already been triggered,
200207 // prevents multiple triggers.
@@ -232,7 +239,7 @@ export default class InfiniteScroll extends Component {
232239 return (
233240 < div style = { outerDivStyle } >
234241 < div
235- className = { `infinite-scroll-component ${ this . props . className || '' } ` }
242+ className = { `infinite-scroll-component ${ this . props . className || "" } ` }
236243 ref = { infScroll => ( this . _infScroll = infScroll ) }
237244 style = { style }
238245 >
0 commit comments