Skip to content

πŸ› Bug Report: Array Index Used as React KeyΒ #640

@annrose2277-glitch

Description

@annrose2277-glitch

πŸ“œ Description

{prs.map((pr, i) => (

  • // ❌ Using index as key is problematic Issue: Using array index i as React key violates React best practices. This causes list items to lose their state when items are reordered, filtered, or removed.

    Impact: Bugs in list rendering, loss of component state, performance degradation.

    Recommended Fix: Use unique identifier like pr.html_url or create unique IDs.

    What browsers are you seeing the problem on?

    No response

    πŸ“ƒ Relevant Screenshots (Links)

    No response

  • Metadata

    Metadata

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions