react-native-swiper
react-native-swiper copied to clipboard
Not updating width/height while rotating device
Hi, I was trying the orientation change with the swiper and it is not updating properly. Any help in this regard ?
is there any fix or a workaround for this issue by now? Experiencing the same problem. @arunraj-qburst @leecade
same issue
have you tried passing width from Dimensions.width instead of using flex layout? @jeffreymendez1993
My solution
const [swiperLayout, setSwiperLayout] = useState({ height: 0, width: 0 })
return (
<View style={{ flex: 1 } onLayout={e => setSwiperLayout(e.nativeEvent.layout)}>
<Swiper
height={swiperLayout.height}
width={swiperLayout.width}
>