leecade / leecade/react-native-swiper

first and last child components' render method runs twice.

Open
#417 8 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

I m using the code below, and if a run this code, with sample data say : Data=[{data...},{data...},{data...},{data..}] then the, render of Child component for Data[0] and Data[3] runs twice.

<Swiper scrollEnabled={this.state.scrollEnabled}
showsButtons={false} showsPagination={false}
loop={true} loadMinimal={false}
index={currentIndex}
onMomentumScrollEnd={(e, state, context) => {
console.warn("index", state.index);
}}>
{
Data.map((item, index) => (

))
}

fix this, or give me solution ASAP

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

No repository file or test is named; start by reproducing the provided Swiper and Child component example with loop enabled and mapped data. Trace the Swiper and Child render behavior, then verify that the first and last Child components render only once without breaking scrolling or pagination behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react, react-native
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.