Skip to content

Commit a791a65

Browse files
MateWWMateusz Wit
andauthored
fix(ios): app crashing while setPage is called in componentDidMount (#261)
Co-authored-by: Mateusz Wit <[email protected]>
1 parent 1d07b5e commit a791a65

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

example/ios/ViewpagerExample.xcodeproj/project.pbxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
children = (
6666
871719007ECC5EAD276C345C /* Pods-ViewpagerExample.debug.xcconfig */,
6767
4D7192F03A36A017E887435B /* Pods-ViewpagerExample.release.xcconfig */,
68+
20F357AD24636CDE00C146DC /* ViewpagerExample-Bridging-Header.h */,
6869
);
6970
path = Pods;
7071
sourceTree = "<group>";
@@ -94,7 +95,6 @@
9495
83CBBA001A601CBA00E9B192 /* Products */,
9596
2D16E6871FA4F8E400B85C8A /* Frameworks */,
9697
1CFFDEF7170271C97B8B7E5A /* Pods */,
97-
20F357AD24636CDE00C146DC /* ViewpagerExample-Bridging-Header.h */,
9898
);
9999
indentWidth = 2;
100100
sourceTree = "<group>";

ios/ReactNativePageView.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,9 @@ - (void)setReactViewControllers:(NSInteger)index
155155
with:(UIViewController *)controller
156156
direction:(UIPageViewControllerNavigationDirection)direction
157157
animated:(BOOL)animated {
158+
if (self.reactPageViewController == nil) {
159+
return;
160+
}
158161
__weak ReactNativePageView *weakSelf = self;
159162
uint16_t coalescingKey = _coalescingKey++;
160163

0 commit comments

Comments
 (0)