fix: validate client state JavaScript identifiers

Closed
HA
1mo ago
+123-0

ClientStateVar names are used as JavaScript bindings, so invalid identifiers or names that conflict with reserved words and generated Reflex bindings can produce broken frontend code.

Validate names when creating a ClientStateVar, and add tests covering rejected names and valid identifiers.

Fixes #6828.

Tests: 27 targeted tests passed; isolated Ruff check passed.