leecade / react-native-swiper

The best Swiper component for React Native.
MIT License
10.43k stars 2.34k forks source link

weird glitch when using useState with another component on the same screen #1337

Open alexisbl14 opened 2 years ago

alexisbl14 commented 2 years ago

Which OS ?

developing on Windows, testing with expo on iOS

Version

Which versions are you using:

Expected behaviour

when clicking a checkbox (bouncy checkbox or pressable) and updating with setState, the current page should not move slightly to the left

Actual behaviour

when clicking a checkbox (bouncy checkbox or pressable) and updating with setState, the current page moves slightly to the left as if someone started swiping it, and it stays there

How to reproduce it>

To help us, please fork this component, modify one example in examples folder to reproduce your issue and include link here.

Steps to reproduce

  1. have slider component as a part of the page
  2. add in some kind of button that updates the state
  3. see how the 2nd page or higher shifts slightly left
talhamujahid52 commented 2 years ago

https://github.com/leecade/react-native-swiper/issues/1266 Add this prop to swiper loadMinimal={true}

pankaj9singh commented 2 years ago

https://github.com/leecade/react-native-swiper/issues/1215#issuecomment-686793558 Worked:

In my package.json I changed: "react-native-swiper": "^1.6.0", to "react-native-swiper": "https://github.com/leecade/react-native-swiper#5827a80002738abd1c0dc08428303c79bbc840c0",