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

Two children with the same key warning when using row, lazyLoading and infinite. #1422

Closed
houkanshan opened this issue Nov 7, 2018 · 3 comments
Labels

Comments

@houkanshan
Copy link

houkanshan commented Nov 7, 2018

Checkout this codesandbox:
https://codesandbox.io/s/k5k9q6q07o

The setting is:

const setting = {
  slidesToShow: 1,
  slidesToScroll: 1,
  infinite: true,
  lazyLoad: true,
  row: 1,
  slidesPerRow: 4
};

image

Also when switch to last page, it will suddenly change to the first page, and the last item will drop to the second line in first page:


EDIT: The two same keys are generate by getKey in track.js

https:/akiran/react-slick/blob/master/src/track.js#L86

One is from child.key, the other is fallbackKey.
Simply change the fallbackKey to be something like 'fallback-' + fallbackKey can fix it. But I'm not sure if this is the right way.

@stale
Copy link

stale bot commented Nov 2, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Nov 2, 2019
@stale stale bot closed this as completed Nov 9, 2019
@lioryemini
Copy link

lioryemini commented Feb 10, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

This issue also occurred to me, and the solution above solve it.
Can we add it to next version fix?

@lioryemini
Copy link

The setting is:

const setting = {
  slidesToShow: 1,
  slidesToScroll: 1,
  infinite: true,
  lazyLoad: true,
  row: 1,
  slidesPerRow: 4
};

@houkanshan I've re-opened this bug as a new issue #1987 . Hopefully this will be fixed.
thanks for reporting it.

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

No branches or pull requests

2 participants