Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Collapse
exlends
Категории
  1. Home
  2. Categories
  3. Фронтенд
  4. React
  5. Each child in a list should have a unique "key" prop

Each child in a list should have a unique "key" prop

Scheduled Pinned Locked Moved React
1 Posts 1 Posters 42 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • kirilljsxK Offline
    kirilljsxK Offline
    kirilljsx
    js
    wrote on last edited by kirilljsx
    #1
    Each child in a list should have a unique "key" prop
    

    Пример:

    {items.map(item => <div>{item.name}</div>)}
    

    Решение: Добавить уникальный key:

    {items.map(item => <div key={item.id}>{item.name}</div>)}
    
    1 Reply Last reply
    0

    Категории

    • Главная
    • Новости
    • Фронтенд
    • Бекенд
    • Языки программирования

    Контакты

    • Сотрудничество
    • info@exlends.com
    • Наш чат
    • Наш ТГ канал

    © 2024 - 2025 ExLends, Inc. Все права защищены.

    Политика конфиденциальности
    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups