You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I may be misunderstanding how this is supposed to work, but it seems like there's a bug with lists of components. Specifically, state is incorrectly preserved when a component is removed.
Try these steps in the linked example:
Click "Hit me!" on each of the counters to generate a unique count. For the sake of argument I'll assume the first has a count of 1, the second 2, and the third 3.
Click the "X" button on the first counter
Verify that there are now 2 counters and the counts are 1 and 2 respectively
I would expect the counts to be 2 and 3 given that we removed the first counter. It's easy to see that the path of the first counter remained the same, which means it inherited the state from the removed counter.
The text was updated successfully, but these errors were encountered:
I may be misunderstanding how this is supposed to work, but it seems like
there's a bug with lists of components. Specifically, state is incorrectly
preserved when a component is removed.
Try these steps in the linked example:
Click "Hit me!" on each of the counters to generate a unique count. For
the sake of argument I'll assume the first has a count of 1, the second 2,
and the third 3.
Click the "X" button on the first counter
Verify that there are now 2 counters and the counts are 1 and 2
respectively
I would expect the counts to be 2 and 3 given that we removed the first
counter. It's easy to see that the path of the first counter remained the
same, which means it inherited the state from the removed counter.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub #6
Demo fiddle: https://jsfiddle.net/montlebalm/m6mkac75/1/
I may be misunderstanding how this is supposed to work, but it seems like there's a bug with lists of components. Specifically, state is incorrectly preserved when a component is removed.
Try these steps in the linked example:
I would expect the counts to be 2 and 3 given that we removed the first counter. It's easy to see that the path of the first counter remained the same, which means it inherited the state from the removed counter.
The text was updated successfully, but these errors were encountered: