Skip to content

Commit 715fe70

Browse files
fix(ios): wrong variable usage that causes crash related to #458 (#502)
Introduced in #455 this should have been `i` instead of `index` all along.
1 parent f82f1ab commit 715fe70

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ios/ReactNativePageView.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ - (void)goTo:(NSInteger)index animated:(BOOL)animated {
265265
if (!isForward && diff > 0) {
266266
for (NSInteger i=_currentIndex; i>=index; i--) {
267267
// Prevent removal of one or many pages at a time
268-
if (index == _currentIndex || i >= numberOfPages) {
268+
if (i == _currentIndex || i >= numberOfPages) {
269269
continue;
270270
}
271271
[self goToViewController:i direction:direction animated:animated shouldCallOnPageSelected: i == index];

0 commit comments

Comments
 (0)