leecade / leecade/react-native-swiper
active dot does not update on swipe when children have changed
Open
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 10.5k
- Forks
- 2.3k
- PR merge metrics
- No merged PRs in 30d
Description
Which OS ?
IOS and android
Version
Which versions are you using:
- react-native-swiper 1.5.14?
- react-native v0.57.8
Expected behaviour
the active dot changes when i swipe
Actual behaviour
the first dot is always highlighted
How to reproduce it>
<Swiper>
{items.map(item => (
<View key={item._id}><Text>{item.label}</Text></View>
))}
</Swiper>
Steps to reproduce
- make sure that items is empty first []
- on a later render. fill
itemswith some objects - active dot is now broken
Workaround:
<Swiper key={items.length}>
{items.map(item => (
<View key={item._id}><Text>{item.label}</Text></View>
))}
</Swiper>
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
Start by reproducing the issue with the provided Swiper snippet: render with an empty items array, then populate it and swipe through the children. Inspect how child updates and the active-dot state are handled; done means the highlighted dot follows the currently swiped child after the items change.
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
- 45/100