cached-read-of-a-plain-field
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 @compute or a hook's props callback reads an ordinary field that is written after the first render, so the cached value goes stale.
The framework reports the same fault while running, as RMD027 — but only once the line actually runs. This is the same fault proved from the source instead.
A @compute caches, and it recomputes when something it TRACKS changes — state and props. A
hook's props callback caches the same way. An ordinary field is neither, so writing one
invalidates nothing and the cached value stays.
The failure is worth picturing, because it is not a missing update. The page renders again for some other reason, everything else on it is correct, and this one value is the answer from before the field changed. Nothing throws and nothing is reported — the number is simply wrong.
Mark the field @state. That is what it is: data the render depends on and something
changes. Nothing else about the component has to move.
A field nothing writes after the first render is NOT reported — a constant a compute reads
can never go stale, and neither can one written in the constructor or @created.
Next
- All rules — the other checks this one runs beside.
- Checking your app — how to run it, and what it proves.