Duolith docs

Warnings while reading a page

W0020 List without a key

Message <list> has no key, so its rows are matched to items by position

Why

Without a key, removing or reordering an item rebuilds every row after it, and focus and typed text stay at the old position, on the wrong item.

How to fix it

Add key={item.id}, or whatever identifies each item for as long as it lives.

In a terminal

duolith explain W0020

Mentioned in