leecade / leecade/react-native-swiper
[Android] Problem updating swiper views
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 10.5k
- Forks
- 2.3k
- PR merge metrics
- No merged PRs in 30d
Description
I have a need for a swiper with dynamic items, some may be added or removed at runtime. This works fine on iOS, but has problems on Android.
Which OS ?
Android
Version
Which versions are you using:
- react-native-swiper v? 1.5.4
- react-native v0.?.? 0.46.4
Expected behaviour
Having a swiper with 4 items and adding some new items (say 2 more for a total of 6) should allow for 6 items to transition between.
Actual behaviour
Depending on the initial amount of items in the swiper, if additional items are added, those additional items will not render correctly. They'll appear blank, and when swiping back to one of the pre-existing items (from the blank views) the transition animation will not occur and instead will jump straight to the item (however swiping between the pre-existing items will have the transition animation).
Steps to reproduce
- Create a swiper with a certain amount of items.
- Call setState increasing the amount of items in the swiper.
- Swipe between the items to see the issue.
Additional notes
The issue seems to be directly related to the swiper's initial state. So if the swiper is initially created with 5 items, then it will only be able to stay at 5 or go lower. Increasing it will cause this issue.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No file or test is named. Start by reproducing the Android case with react-native-swiper 1.5.4 and React Native 0.46.4: increase the item count after mounting, then swipe through the new items. Done means newly added items render and transitions behave like the pre-existing items.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react-native
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100