meliorence / meliorence/react-native-snap-carousel

Carousel refresh when snapToPrev() or scroll back

Open
#693 2 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

Not sure it this an issue.

When i load 20 items, and use snapToPrev() or scroll back to last item.
code as below

<Carousel
              ref={(c) => { this._foodcarousel = c; }}
              layout={'default'}
              sliderWidth={sliderWidth}
              itemWidth={itemWidth}
              data = {this.state.food_dataSource}
              renderItem={this._renderCarouselItem}
              loop={true}
              autoplay={true}
              autoplayInterval={5000}
            />

let say the item is sort like
[19],[20],[1],[2],[3]
[1]: main view

At here i use snapToPrev() or scroll back to [20], and suddenly whole carousel item is being refresh. Are we able to avoid this from refresh. I think it is not necessary to refresh.

"react": "16.9.0",
"react-native": "^0.60.5",
"react-native-snap-carousel": "^3.9.0",

Contributor guide

Open the contributing guide

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 by reproducing the behavior with the supplied Carousel configuration, 20 items, loop enabled, and snapToPrev() or backward scrolling to item 20. Compare the carousel's refresh behavior when moving from item 1 back to item 20; done means returning to the previous item without refreshing the whole carousel.

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
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.