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 = {
4545 isFooterRefreshing : boolean ; // Whether the tail is refreshing
4646 footerState : RefreshState ;
4747} ;
48-
48+ let callOnScrollEnd = false ;
4949export default class RefreshListView < ItemT > extends Component <
5050 Props < ItemT > ,
5151 State
@@ -146,6 +146,7 @@ export default class RefreshListView<ItemT> extends Component<
146146 scrollEventThrottle = { 16 }
147147 onScroll = { this . _onScroll . bind ( this ) }
148148 ListFooterComponent = { this . _renderFooter }
149+ onEndReached = { ( ) => ( callOnScrollEnd = true ) }
149150 />
150151 ) ;
151152 }
@@ -157,10 +158,11 @@ export default class RefreshListView<ItemT> extends Component<
157158 let height = event . nativeEvent . layoutMeasurement . height ;
158159 let contentHeight = Math . floor ( event . nativeEvent . contentSize . height ) ; //Solve the problem of not triggering Android loading more
159160
160- if ( this . shouldStartFooterRefreshing ( ) ) {
161+ if ( callOnScrollEnd && this . shouldStartFooterRefreshing ( ) ) {
161162 if ( offsetY + height >= contentHeight ) {
162163 console . log ( 'load more' ) ;
163164 this . startFooterRefreshing ( ) ;
165+ callOnScrollEnd = false ;
164166 }
165167 }
166168
You can’t perform that action at this time.
0 commit comments