nick / react-native-carousel

Carousel component for react-native
MIT License
458 stars 107 forks source link

Doesn't render with correct InitialPage when greater than 0. #85

Open hkung77 opened 7 years ago

hkung77 commented 7 years ago

I'm on React 16 and react native 48.

Passing an initialPage but it doesn't seem to be working anymore. Only occurring on IOS. Android seems fine.

I was able to do a workaround by wrapping the scrollToPage within a setTimeOut.

   if (Platform.OS === 'ios') {
      setTimeout(() => {
        this.carousel.refs.pager.scrollToPage(this.props.initialPage, false);
      }, 0);
    }