fresh-object-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 — a context Provider above all — is handed an object or array built inside its props callback, where the callback also reads something reactive, so the value is rebuilt and every consumer of that key wakes with contents that did not change.
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 rebuilt object is a CHANGED prop. For a context Provider that reaches every consumer of the key, however far down the tree it sits: measured, a consumer reading one key rendered four times over three changes to a DIFFERENT key.
The callback itself is not the problem — it is cached on the signals it reads, and one that reads none is called once at mount, so a literal inside it keeps one identity forever. This is reported only where the callback also reads something that can make it run again.
The fix is on the HOOK, which is the thing that knows whether a prop is a value or an
identity: @StableProps("conf"). The framework then hands back the identity it already had
while the contents match, and consumers stay asleep.
A context Provider is not a class you wrote, so it takes the declaration where the context is CREATED:
const [ConfProvider, ConfConsumer] = createContext(
{ conf: { dense: false } },
{ stableProps: ["conf"] },
);
Or move the value out of the callback entirely — a @compute gives you the same object back
until something it reads changes, which is exactly what a consumer needs.
Next
- All rules — the other checks this one runs beside.
- Checking your app — how to run it, and what it proves.