Skip to content

Type Alias: ComponentState ​

ts
type ComponentState = Record<string, JsonValue>;

Named state values for one component. The component's state schema describes the available keys and accepted values. For example, a region menu may have { filter: "EMEA" }.

Set a key to null to clear it, such as emptying an input or clearing a chart brush. Reads omit keys with no value. Passing a state snapshot back to setState updates only the values in that snapshot; omitted keys remain unchanged.