How to generate ID's on my existing data array with 20 id's/users on JavaScript/React
This is my data.js. I want to increment the last existing data to plus 1 if I add another user to my table. I used nanoid from my previous generating ids to my userRows data. But I want my id to increment by 1. For example, the last user that I created has an ID of 20 and I want my next user would be 21. Can someone help me or guide me to fix my generating ids? Thank you in advance. export const userRows = [ { id: 1, username: "Richy", fullName: "Richy Doe", img: "https://demos.themeselection.com/materio-mui-react-nextjs-admin-template/demo-1/images/avatars/3.png", status: "active", email: "Ri
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.