react-native-swiper
react-native-swiper copied to clipboard
swiping after orientation change does not work as expected when initial index is defined
- react-native-swiper v1.5.13
- react-native v0.43.0
when changing orientation the first swipe goes to the index defined as the initial index, instead of the index swiped to.
thx :)
I'm seeing this issue as well, regardless if the initial index is defined. Did you ever figure out a workaround?
Hey! I found a workaround for this issue:
- I keep the current index in my component's state
- I pass the index as a prop when creating the Swiper
<Swiper
index={this.state.index}
onIndexChanged={index => {
this.setState({ index });
}}
/>
@ericluong you save my life <3
That not work for me on functional components.
After set state with hook, component move to wrong "tab" index