diff --git a/React/Views/RCTRefreshControl.m b/React/Views/RCTRefreshControl.m index 5d24ffadc7d113..a0f8edb6f34487 100644 --- a/React/Views/RCTRefreshControl.m +++ b/React/Views/RCTRefreshControl.m @@ -14,6 +14,7 @@ @implementation RCTRefreshControl { BOOL _initialRefreshingState; BOOL _isInitialRender; + BOOL _currentRefreshingState; } - (instancetype)init @@ -21,6 +22,7 @@ - (instancetype)init if ((self = [super init])) { [self addTarget:self action:@selector(refreshControlValueChanged) forControlEvents:UIControlEventValueChanged]; _isInitialRender = true; + _currentRefreshingState = false; } return self; } @@ -94,7 +96,9 @@ - (void)setTitle:(NSString *)title - (void)setRefreshing:(BOOL)refreshing { - if (self.refreshing != refreshing) { + if (_currentRefreshingState != refreshing) { + _currentRefreshingState = refreshing; + if (refreshing) { // If it is the initial render, beginRefreshing will get called // in layoutSubviews. @@ -111,6 +115,8 @@ - (void)setRefreshing:(BOOL)refreshing - (void)refreshControlValueChanged { + _currentRefreshingState = super.refreshing; + if (_onRefresh) { _onRefresh(nil); }