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

Remove current index #554

Open
minuitagency opened this issue Jul 9, 2019 · 2 comments
Open

Remove current index #554

minuitagency opened this issue Jul 9, 2019 · 2 comments

Comments

@minuitagency
Copy link

Hi,

We have a carousel in our app, we need to give the user the ability to remove the current slide once he read it.

Problem being, when we slice the item from the array, the carousel jumps two slides ahead and not to the next slide...

Thanks,

Théo

@flyandi
Copy link

flyandi commented Aug 30, 2019

I had the same/similar issue and solved by assigning an explicit key to the component rendered in the renderItem iterator.

Basically the problem is that React does not see the item changed and just re-renders the data and not the actual component - that's why it looks like you jumping ahead because technically the item was never removed.

Hope that helps.

@dohooo

This comment was marked as spam.

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

3 participants