Skip to content

Type Alias: ComponentState

ts
type ComponentState = Record<string, JsonValue>;

One component's state: a bag of named values in that component's own vocabulary. The component defines the keys and shapes.

null is a write-side command, not a value: writing null for a key clears it (component-interpreted — an empty input, a cleared brush). It is deliberately not how an empty key is reported back. A component with nothing set omits the key, so a reported state bag round-trips: handing an observed snapshot straight back to set re-asserts exactly what was set and stays silent about the rest, instead of firing a clear at every key that was already empty. Absence means the same thing in both directions — "nothing to say about this key".

Ridge AI