function-built-in-hook-props
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 hook is handed a function built inside its props callback, where the callback also reads something reactive, so the prop is a new function every time it runs.
The framework reports the same fault while running, as RMD022 — but only once the line actually runs. This is the same fault proved from the source instead.
A hook's props are signals, so a new function is a CHANGED prop: whatever watches it runs again,
with nothing changed. Hand over a method instead — fetch: self.load — which reads this when
it is called, so there is nothing to capture and its identity never changes. For one built per
argument, @memoized. Declaring the prop with @StableProps cannot help: two functions are
never equal by content.
Next
- All rules — the other checks this one runs beside.
- Checking your app — how to run it, and what it proves.