row-without-a-key
This fails the run. Where it is wrong about your code, // ramonda-check-ignore <reason> on the line says so, and the reason is printed on every run.
Reported when a row built by map or by list() has no key.
The framework reports the same fault while running, as RMD023 and RMD051 — but only once the line actually runs. This is the same fault proved from the source instead.
Give each row a key from your data — an id. Not the array index, which IS the position and
so says nothing a position did not already say.
A finding names which of the two it found, and they fail differently.
map has no identity without a key at all: rows are matched by position, so inserting or
removing anywhere but the end hands every row below it the previous row's state and DOM.
list infers one from what makes a row different from its siblings, and a key you write
wins over it. The inference can fail — a row whose every field is nested or shared with its
siblings has nothing to be told apart by — and it matters most in the commonest case of all:
data that arrives fresh, where every object is new and no reference is left to recognise.
Next
- All rules — the other checks this one runs beside.
- Checking your app — how to run it, and what it proves.