File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ type State = {
45
45
isFooterRefreshing : boolean ; // Whether the tail is refreshing
46
46
footerState : RefreshState ;
47
47
} ;
48
-
48
+ let callOnScrollEnd = false ;
49
49
export default class RefreshListView < ItemT > extends Component <
50
50
Props < ItemT > ,
51
51
State
@@ -146,6 +146,7 @@ export default class RefreshListView<ItemT> extends Component<
146
146
scrollEventThrottle = { 16 }
147
147
onScroll = { this . _onScroll . bind ( this ) }
148
148
ListFooterComponent = { this . _renderFooter }
149
+ onEndReached = { ( ) => ( callOnScrollEnd = true ) }
149
150
/>
150
151
) ;
151
152
}
@@ -157,10 +158,11 @@ export default class RefreshListView<ItemT> extends Component<
157
158
let height = event . nativeEvent . layoutMeasurement . height ;
158
159
let contentHeight = Math . floor ( event . nativeEvent . contentSize . height ) ; //Solve the problem of not triggering Android loading more
159
160
160
- if ( this . shouldStartFooterRefreshing ( ) ) {
161
+ if ( callOnScrollEnd && this . shouldStartFooterRefreshing ( ) ) {
161
162
if ( offsetY + height >= contentHeight ) {
162
163
console . log ( 'load more' ) ;
163
164
this . startFooterRefreshing ( ) ;
165
+ callOnScrollEnd = false ;
164
166
}
165
167
}
166
168
You can’t perform that action at this time.
0 commit comments