callstack / react-native-pager-view

React Native wrapper for the Android ViewPager and iOS UIPageViewController.
MIT License
2.72k stars 418 forks source link

TypeError thrown with conditional pages #321

Closed rissois closed 3 years ago

rissois commented 3 years ago

Environment

iOS 14.4 simulator "react-native-pager-view": "^5.1.2",

Description

Conditional rendering of a page throws TypeError: null is not an object (evaluating '_ref.props') when condition is not met.

NOTE: This is a new problem, this did not occur with @react-native-community/viewpager 4.2.0

Reproducible Demo

Should be reproducible with this simple code:

<PagerView style={styles.pagerView} initialPage={0}>
    <View />
    {false && <View />}
</PagerView>
imranMnts commented 3 years ago

Linked to this PR? https://github.com/callstack/react-native-pager-view/pull/354

hotaryuzaki commented 11 months ago

Linked to this PR? #354

is there any solution for this other than manually merging the PR?