question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Key-based reordering doesn't work

See original GitHub issue

I have started working on a test for key-based element reordering.

I suspected this wasn’t working, so I decided to build a practical example:

https://codesandbox.io/s/fre-demo-uxuic

In this example, I have a list of counter IDs only (in counters in App) with the actual counter values being maintained in instances of Counter.

As you can see, I’m using a key-attribute on the <Counter/> instances, so the instances (with state) should be preserved between updates - which they are.

But the order of the component instance elements does not get updated.

Here’s an image to explain:

image

As you can see in the console the “Remove” button handler has reversed the order of the counter IDs from 1, 2, 3 to 3, 2, 1.

But as shown with the red lines, the order of the components in the DOM is still 1, 2, 3, so the reordering doesn’t seem to work.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:17 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
mindplay-dkcommented, Oct 9, 2019

Looks solid! 😀🎉

So at this point, I would suggest, hold off making anymore changes to reconciliation, until we have the test in place - making changes at that point will be much safer.

I will try to finish the test soon.

1reaction
yisarcommented, Oct 6, 2019

I saw the use cases and probably knew where was wrong. We can continue testing other use cases. Then I’ll fix it as soon as possible until I get online.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What to do when key-based authentication isn't working after ...
To set up key-based authentication from my laptop to the server, I generated a new SSH keypair (named “ubuntu”) on my Mac using...
Read more >
Sort Dictionary by Key Based on Values in Array
A dictionary, by definition, doesn't have an order. However, you can have an array of sorted items by touples or implement your sorted ......
Read more >
[Hypothetical] Keybase.io has received an NSL #901 - GitHub
Makes [keybase] hand over encrypted private keys, then works on brute forcing ... (This property doesn't hold for traditional cascades).
Read more >
Why am I still getting a password prompt with ssh with public ...
Oddly enough, I was having problems with an account a friend set up on his VPS getting pubkey auth working. I thought all...
Read more >
Configuring SSH Public Key Authentication on Windows
SSH key-based authentication is widely used in the Linux world, ... Open a standard (non-elevated) PowerShell session and generate a pair of ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found