easy5 pts · first answer countsreactstate-management
Keys for rows loaded from an API
A React list renders comments from your API using key={index}. When a user deletes the first comment, the half-typed reply in row 2 suddenly appears under a different comment. What is the fix?
Discussion 0
Join free to post in the discussion.
Related questions
- Optimistic update failsFull Stack Developer
- Search shows results for old inputFull Stack Developer
- User bios rendered as HTMLFull Stack Developer
- Hydration mismatch with timeFull Stack Developer
- Why React lists need keysFrontend Developer
- Input that ignores typingFrontend Developer
- Changing a prop inside a childFrontend Developer
- Multiple setState callsFrontend Developer