Skip to content

Keeping the IDs in sync#1

Open
eric-fleming wants to merge 3 commits intosanderdebr:masterfrom
eric-fleming:master
Open

Keeping the IDs in sync#1
eric-fleming wants to merge 3 commits intosanderdebr:masterfrom
eric-fleming:master

Conversation

@eric-fleming
Copy link

I found your article on Dev.to to learn more about React, THANKS!
I noticed that the indexes were off when someone creates or deletes users.

  • Originally the first new user index was one ahead.
  • Also deleting records made it possible to have multiple copies of the same ID since it was tied to length.

TLDR: I made a new state variable to keep track of the last user ID.

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

Successfully merging this pull request may close these issues.

1 participant