Skip to content
This repository has been archived by the owner on Apr 5, 2024. It is now read-only.

Incorrect behavior when changing elements in the slider #65

Open
zavsievich opened this issue Jul 12, 2023 · 0 comments
Open

Incorrect behavior when changing elements in the slider #65

zavsievich opened this issue Jul 12, 2023 · 0 comments

Comments

@zavsievich
Copy link

zavsievich commented Jul 12, 2023

I have an array of arrays. I'm rendering the child arrays as slider elements. When I change the state, I change the array that the slider renders. Instead of swapping elements, it renders new slides internally, bloating the DOM and duplicating navigation elements.
This behavior is reproduced if slider elements have a unique key. If you remove the key (react swears on this), the bug doesn't reproduce.

Representation:
https://codesandbox.io/s/dawn-paper-y8pld4?file=/src/App.js

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

No branches or pull requests

1 participant