leecade / leecade/react-native-swiper

Current index state is not updating when a api call is happening on index call

Open
#1,052 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
10.5k
Forks
2.3k
PR merge metrics
No merged PRs in 30d

Description

current index state is not updating when a api call is happening on index call

<Swiper style={styles.wrapper}
key={Utils.randomString()}
showsButtons={true}
showsPagination={false}
onScrollBeginDrag={this.stopVideo}
onIndexChanged={this.loadMorePosts}
animated={false}
index={this.state.currIndex}
containerStyle={{flex: 1}}
loop={false}>
{this.renderSwipeView()}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Swiper usage shown in the issue, especially the index prop tied to currIndex and the onIndexChanged handler loadMorePosts. Reproduce the behavior while the API call is in progress and trace whether the current index changes as expected. Done means the index state updates correctly during the API call and the Swiper reflects it.

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
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.