Skip to content
Discussion options

You must be logged in to vote

Before anything is deleted, you have:

editingUid index 0: user 1
editingUid index 1: user 2
editingUid index 2: user 3

After deleting the item at index 1, you have:

editingUid index 0: user 1
editingUid index 1: user 3

When you remove an item, you aren't clearing the editingUid. This means that the description's input is still associated with index 1, which is now "user 3".

Try this code:

<button type="button" onClick={() => {
    setEditingUid(null);
    remove(index);
}}>

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@tatsuya-asami
Comment options

@BrendanC23
Comment options

@tatsuya-asami
Comment options

Answer selected by tatsuya-asami
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants