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

Bug with lists? #6

Open
montlebalm opened this issue May 24, 2016 · 1 comment
Open

Bug with lists? #6

montlebalm opened this issue May 24, 2016 · 1 comment

Comments

@montlebalm
Copy link

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:

  1. 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.
  2. Click the "X" button on the first counter
  3. 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.

@rstacruz
Copy link
Owner

Ooh that's clever. Thanks for the detailed description.

On Wed, May 25, 2016, 5:50 AM Chris Montrois notifications@github.com
wrote:

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:

  1. 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.
  2. Click the "X" button on the first counter
  3. 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

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

2 participants