@@ -87,11 +87,7 @@ export default class InfiniteScroll extends Component {
8787
8888 componentWillReceiveProps ( props ) {
8989 // do nothing when dataLength and key are unchanged
90- if (
91- this . props . key === props . key &&
92- this . props . dataLength === props . dataLength
93- )
94- return ;
90+ if ( this . props . key === props . key && this . props . dataLength === props . dataLength ) return ;
9591
9692 this . actionTriggered = false ;
9793 // update state when new data was sent in
@@ -102,9 +98,8 @@ export default class InfiniteScroll extends Component {
10298 }
10399
104100 getScrollableTarget ( ) {
105- if ( this . props . scrollableTarget instanceof HTMLElement )
106- return this . props . scrollableTarget ;
107- if ( typeof this . props . scrollableTarget === "string" ) {
101+ if ( this . props . scrollableTarget instanceof HTMLElement ) return this . props . scrollableTarget ;
102+ if ( typeof this . props . scrollableTarget === 'string' ) {
108103 return document . getElementById ( this . props . scrollableTarget ) ;
109104 }
110105 if ( this . props . scrollableTarget === null ) {
@@ -124,8 +119,7 @@ export default class InfiniteScroll extends Component {
124119 this . currentY = this . startY ;
125120
126121 this . _infScroll . style . willChange = "transform" ;
127- this . _infScroll . style . transition =
128- "transform 0.2s cubic-bezier(0,0,0.31,1)" ;
122+ this . _infScroll . style . transition = `transform 0.2s cubic-bezier(0,0,0.31,1)` ;
129123 }
130124
131125 onMove ( evt ) {
@@ -149,7 +143,7 @@ export default class InfiniteScroll extends Component {
149143 this . startY } px, 0px)`;
150144 }
151145
152- onEnd ( ) {
146+ onEnd ( evt ) {
153147 this . startY = 0 ;
154148 this . currentY = 0 ;
155149
@@ -162,9 +156,9 @@ export default class InfiniteScroll extends Component {
162156 requestAnimationFrame ( ( ) => {
163157 // this._infScroll
164158 if ( this . _infScroll ) {
165- this . _infScroll . style . overflow = "auto" ;
166- this . _infScroll . style . transform = "none" ;
167- this . _infScroll . style . willChange = "none" ;
159+ this . _infScroll . style . overflow = "auto" ;
160+ this . _infScroll . style . transform = "none" ;
161+ this . _infScroll . style . willChange = "none" ;
168162 }
169163 } ) ;
170164 }
@@ -184,8 +178,7 @@ export default class InfiniteScroll extends Component {
184178 }
185179
186180 return (
187- target . scrollTop + clientHeight >=
188- ( threshold . value / 100 ) * target . scrollHeight
181+ target . scrollTop + clientHeight >= threshold . value / 100 * target . scrollHeight
189182 ) ;
190183 }
191184
@@ -200,8 +193,8 @@ export default class InfiniteScroll extends Component {
200193 this . props . height || this . _scrollableNode
201194 ? event . target
202195 : document . documentElement . scrollTop
203- ? document . documentElement
204- : document . body ;
196+ ? document . documentElement
197+ : document . body ;
205198
206199 // return immediately if the action has already been triggered,
207200 // prevents multiple triggers.
@@ -239,7 +232,7 @@ export default class InfiniteScroll extends Component {
239232 return (
240233 < div style = { outerDivStyle } >
241234 < div
242- className = { `infinite-scroll-component ${ this . props . className || "" } ` }
235+ className = { `infinite-scroll-component ${ this . props . className || '' } ` }
243236 ref = { infScroll => ( this . _infScroll = infScroll ) }
244237 style = { style }
245238 >
0 commit comments