Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access changing slides during renders #9

Open
satazor opened this issue Mar 14, 2020 · 0 comments
Open

Access changing slides during renders #9

satazor opened this issue Mar 14, 2020 · 0 comments

Comments

@satazor
Copy link
Contributor

satazor commented Mar 14, 2020

Ideally, react-carousel should be reactive and deal with changes to slides:

  • Whenever a new slide is added, to the start, end or middle.
  • Whenever a new slide is removed, from the start, end or middle.

The current implementation uses indices to identify the current slide, which will be out-of-sync when the slides change. Ideally, the current slide should be kept as current, regardless of its index. If the current slide is removed, then the previous should be set as the current instead.

One way to do this is to identify slides by their key. Please note that we may still have the notion of indices, like: current and currentIndex, previous and previousIndex.

Access how react-carousel deals with changes to slides and implement the necessary changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant