meliorence / meliorence/react-native-snap-carousel

How to reset the active index (this._activeIndex) to 0

Open
#566 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I want to reset the active index when the carousel component is not unmounted but new data is passed to the component.
I am using this carousel for a color selection swatch where when I change the color, I want to reset the active index. How can I do that?

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 tracing how the carousel handles incoming data and stores this._activeIndex; the issue names no files or tests. Determine whether the existing component API supports resetting the index without unmounting, and consider the work complete when a data update reliably returns the active index to 0.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react-native
Domain
mobile
Issue type
Feature
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.